ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE 1.7 removing content of Javascript

January 23, 2011 7:48pm

Subscribe [4]
  • #1 / Jan 23, 2011 7:48pm

    Mr Goongs

    30 posts

    Hello,

    Since upgrading to EE1.7 I’ve noticed my templates behaving slightly oddly. After comparing the outputed code from the 1.6.7 site and the 1.7.0 site it appears that EE is removing all the javascript code that would normally sit inside curly braces {}.

    I’m guessing EE isn’t distinguishing between javascript code and its own tags now. Is there a setting to change this?

    Thanks!

  • #2 / Jan 24, 2011 9:14am

    Sue Crocker

    26054 posts

    Do you have an example we can see?

  • #3 / Jan 24, 2011 12:03pm

    Mr Goongs

    30 posts

    Sure, Here’s a piece of javascript code sent to the browser on the new 1.7 site:

    [removed]
        $(document).ready(function(){
            $('#submit').hover(
                function(){ 
                    $(this).attr();
                },
                function(){ 
                    $(this).attr();             }
            );
        });
    [removed]

    and here’s the same piece of code from the same page (the php files are identical) sent to the browser of my EE1.6.7 installation (this is the correct one):

    [removed]
        $(document).ready(function(){
            $('#submit').hover(
                function(){ 
                    $(this).attr({ src : '../../../images/booknowr.gif'});
                },
                function(){ 
                    $(this).attr({ src : '../../../images/booknow.gif'});             }
            );
        });
    [removed]
  • #4 / Jan 25, 2011 8:18am

    Sue Crocker

    26054 posts

    I’m not much on javascript, but the path to the images should be parsing from the root..

  • #5 / Jan 25, 2011 9:20am

    Mr Goongs

    30 posts

    Hello sue,

    This isn’t really an issue which needs knowledge of JavaScript. The script is fine it is expression engine which is parsing the curly braces as it’s own tags which it shouldn’t be doing. So why is this happening?

    The URL works fine as it is but I’ll keep that in mind.

  • #6 / Jan 25, 2011 1:43pm

    Design by Front

    106 posts

    Hey there,

    You should check the “Debug Preference” in Admin ›  System Preferences ›  Output and Debugging Preferences.

    If it is set to “0” try changing it to “1” and see if that helps. That setting seems to interfere with javascript parsing.

    If that doesn’t work, try adding this line of code to your config.php file.

    $conf['protect_javascript'] = "n";

    Hope this helps,
    Chuck

  • #7 / Jan 25, 2011 2:11pm

    Mr Goongs

    30 posts

    Chuck - Thank you!

    Changing debug preference to “1” sorted out everything and the site appears to be running perfectly again!

    Thanks for taking the time to post that solution because I don’t think we would have got there otherwise. Really appreciate it.

    Chris.

  • #8 / Jan 25, 2011 3:20pm

    Design by Front

    106 posts

    You are most welcome chris - glad you got it sorted 😊

  • #9 / Jan 26, 2011 4:03am

    John Henry Donovan

    12339 posts

    Thanks for the assist Check. Feel free Chris to start a new thread if you have any more questions

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases