Javascript in HTML Block

Permalink
Ok I am trying to add FatFreeCarthttp://www.fatfreecart.com to a c5 site. When I insert the code the edit bar disappears. I can see that this is a javascript issue but don't know how to deal with it.

The script works perfectly in the c5 page but the page is no longer editable. If I want to change it I have to restore a previous version and put everything back in.

It appears that c5 will have to be changed to make this work but wanted to post here and see if anyone else has resolved this problem.

Here is the JS code that is being called buy FatFreeCart:

<!--
  FatFreeCart.com AddToCart Snippet
  @version: 0.1
  @date: 07/30/2007
  @author: Ropu (rovagnati at gmail)
  //-->
  <table cellspacing="2" cellpadding="2" bgcolor="#ffffff" style="border: thin solid rgb(100,100,100);font-family: Verdana; font-size: 11px; color: rgb(0, 0, 0);">    
    <tr align="center">
      <th bgcolor="#dddddd" style="color: rgb(0, 0, 0);">Class Registration Fee</th>
    </tr>
    <tr>
      <td align="center">
      <!-- ADD TO CART button code. -->
        <form target="ej_ejc" action="https://www.e-junkie.com/ecom/fgb.php?c=cart&cl=1&ejc=2" method="post">
        <div style="background:#eeeeee">

carlanw
 
Tony replied on at Permalink Reply
Tony
there's a problem with the HTML block, that may or may not be related to your issue (htmlentities fix is posted down below):
http://www.concrete5.org/index.php?cID=17936...

btw, do you have firebug loaded up and are you seeing any javascript errors?
carlanw replied on at Permalink Reply
carlanw
Sorry didn't think to check firebug. Yes there is an error:

Code tags hate me the source file is just the url+/concrete/js/ccm.dialog.js

Error: jQuery.fn.dialog is undefined
Source File: http://www.site.com/concrete/js/ccm.dialog.js
Line: 374


Don't know if that means anything to you or not but its beyond me.

Thank you for your help.

Carlan
carlanw replied on at Permalink Reply
carlanw
When I am not in edit mode there is no JS error in Firebug... aka go and manually approve the page and then view it the FatFreeCart works fine and there is no error...

Still doens't solve the page edit problem though! :)
platypusman replied on at Permalink Reply
platypusman
Don't know if you ever got this figured out, but I and some others ran into the same problem (Edit bar disappearing) when linking to other js libraries. (http://www.concrete5.org/community/forums/customizing_c5/typekit_in... ) It seems to make a difference in what order the scripts are loaded -- in my case I had to put the extra js links *before* the Loader::element('header_required'); element and then the Edit bar returned and worked normally again.

You could try linking to the js files in the head of the template, rather than inside your php block at the end.
fr0z3nk0 replied on at Permalink Reply
I was experiencing the same issue when suddenly I couldn't edit most of the pages.

I figured that it was down to loading jquery twice.

First time its loaded it in header_required and second time in page_controls_header.

Maybe it was me editing those files and I might have added one of those includes. If not then it is probably something you guys should look at and fix it.

i'm using concrete 5.3.3.1

Peter
mkharisecario replied on at Permalink Reply
mkharisecario
I've found some case when we must put reference js before header_required loader as platypusman said...

so far I can use 2 solution :
-delete conflicted js, and
-put reference js before header_required

dunno if there is any other simple solution?
SVijay replied on at Permalink Reply
SVijay
Hi,

Yes as mkharisecario said remove JQuery supporting file or it may conflict. Jquery supporting file is inbuilt in concrete5.
mkharisecario replied on at Permalink Reply
mkharisecario
Did you have this code in your html code?

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>


if yes, I think you must delete that script. I've had same problem before because of that line. But it fixed after I deleted it.

*refering to:
http://www.concrete5.org/community/forums/chat/jquery-is-not-a-func...