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.

unexpected behaviour when using prototype accordion

January 02, 2010 2:05am

Subscribe [3]
  • #1 / Jan 02, 2010 2:05am

    atelier2

    181 posts

    Hi
    I’m trying to get a accordion script to work (I did not write that code myself)
    The odd thing is that the Template outside EE works as expected. But once the page get processed, EE completely strips some parts of the HTML, and of the script code.
    In the Template is this:

    On line 15:
    html { height:100% }
    
    On line 27-33:
    var params = {duration:0.2};
            if (this.next('div')) {
                Effect.toggle(this.next('div'),'blind',params);
            }else{
                if(this.up().next('div')){
                    Effect.toggle(this.up().next('div'),'blind',params);
                }
    
    And on line 39:
        heads.invoke('setStyle',{cursor:'pointer'});

    Parsed comes out this:

    On line number 15:
    html 
    
    On line number 27-28-29
    var params = ;
            if (this.next('div')) {Effect.toggle(this.next('div'),'blind',params);}else{
                if(this.up().next('div')){Effect.toggle(this.up().next('div'),'blind',params);}
    
    On line number 35
        heads.invoke('setStyle',);

     

    Thanks.

  • #2 / Jan 02, 2010 6:51pm

    atelier2

    181 posts

    Same situation here with build 1.6.8
    EE strips some code between {...} as I also mentioned here: http://ellislab.com/forums/viewthread/140064/

    We tested the same Template in a 1.6.7 build, that one worked fine.

  • #3 / Jan 02, 2010 6:52pm

    atelier2

    181 posts

    Update: we discovered this post here:
    http://ellislab.com/forums/viewthread/136769/

  • #4 / Jan 03, 2010 5:10pm

    Greg Salt

    3988 posts

    Hi Wil,

    If you structure your code like this:

    foo {
        bar;
    }

    does the problem still occur? Also, is this a Javascript template or embedded JS?

    Cheers

    Greg

  • #5 / Jan 03, 2010 7:28pm

    atelier2

    181 posts

    Hi Greg

    As for my problem, yes, it’s embedded js, but more serious, EE also strips code that belongs to the embedded CSS of that page. And, if run the template in a 1.6.7 build, this does not occur.
    Since I updated to 1.6.8 code also gets stripped of other templates without that js.

    body { margin:0px; background-color:#000; height:100% }
    html { height:100% }

    becomes now

    body { margin:0px; background-color:#000; height:100% }
    html
  • #6 / Jan 04, 2010 1:43am

    John Henry Donovan

    12339 posts

    atelier2

    I merged the threads so we have better visiblity regarding your issue.

    EE also strips code that belongs to the embedded CSS of that page.

    How do you mean embedded?
    Do you mean embedded within a <style> using the embed tag or linking to a CSS template in the normal manner? Or is it just hard-coded within the template?

    Can you show us some more of that template please where the CSS is embedded?

  • #7 / Jan 04, 2010 4:41am

    atelier2

    181 posts

    Hi John Henry

    Thanks for looking at this. To be sure, I attach a files as zip file, I noticed that my code changes here on the forum (I see parts with [REMOVED]
    Thank you.

  • #8 / Jan 04, 2010 7:05pm

    Adam Dorsey

    1439 posts

    Hi-
    I tried replicating your issue, and could not. It doesn’t strip out the “html” css portion. My rendered code is intact.

    Are you running any extensions?

    Adding this to your config.php file, may prevent the javascript from being muddled.

    $conf['protect_javascript'] = "n";
  • #9 / Jan 04, 2010 7:39pm

    atelier2

    181 posts

    Thanks

    Adding that code to the config file does NOT make a change.
    Template code original

    <!-- 
    body { margin:0px; background-color:#000; height:100% }
    html { height:100% }
    #navtop a:link { color:#000; text-decoration:none }

    still becomes :

    <!-- 
    body { margin:0px; background-color:#000; height:100% }
    html 
    #navtop a:link { color:#000; text-decoration:none }

    Extentions? Yes, Simple Translator (v.1.0.9)  Easily switch between languages. But that one is not in function.
    And I’m on Build:  20090915

  • #10 / Jan 04, 2010 7:41pm

    Adam Dorsey

    1439 posts

    Can you upgrade to the latest build (Build: 20091201), to rule out file corruption? Also, if you still have the same issue, can you globally disable your extensions?

  • #11 / Jan 04, 2010 8:20pm

    atelier2

    181 posts

    Done that.
    Now the site does not work anymore.

    error code:

    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/atelier/monumentmaker.nl/mm/core/core.functions.php(634) : eval()'d code on line 436

    Now what?

  • #12 / Jan 04, 2010 8:41pm

    Adam Dorsey

    1439 posts

    I’m sorry to hear that. Did you follow the update instructions here?

    Is this error on your front-end or is this error in the CP?

  • #13 / Jan 04, 2010 8:42pm

    atelier2

    181 posts

    This is bizarre.

    Before I performed the update, I made sure I made a back-up of my whole build.
    So, after the error, I decided to undo the update, and I replaced all NEW folders: system/core - system/cp - system/db - system/lib - system/modules -  system/plugins with the OLD backup files. And emptied caches.

    Now the site is on line again.

    And the problem is gone.

    <!-- 
    body { margin:0px; background-color:#000; height:100% }
    html {height:100%}
    #navtop a:link { color:#000; text-decoration:none }

    is the same as in the template. No stripping of code.

    And the javascrip as mentioned above is intact, more that that, it works as expected.

    Conclusion maybe some corrupt file on the server? How come?

    Should I update to the latest build now again?

  • #14 / Jan 04, 2010 8:44pm

    Adam Dorsey

    1439 posts

    I would say that it indeed was a corrupt file. Or maybe something funky in the cache.

    We always recommend updating because of bug fixes and security updates.

  • #15 / Jan 04, 2010 8:47pm

    atelier2

    181 posts

    OK, understood.

    I want to thank you all for paying attention to this.
    You are indeed a great team.

    Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases