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.

JS Code not rendering properly

June 24, 2011 3:02pm

Subscribe [4]
  • #1 / Jun 24, 2011 3:02pm

    Hyun Lee

    39 posts

    Hi, I implemented this code below in one of my templates.

    [removed]
                stepcarousel.setup({
                    galleryid: 'gallerya', //id of carousel DIV
                    beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
                    panelclass: 'panel', //class of panel DIVs each holding content
                    autostep: {enable:true, moveby:1, pause:3000},
                    panelbehavior: {speed:900, wraparound:true, persist:false},
                    defaultbuttons: {enable: true, moveby: 1, leftnav: ['imgs/butt_prev.png', -47, 200], rightnav: ['imgs/butt_next.png', 10, 180]},
                    contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
                })
            
            [removed]

    but the browser renders it like so leaving out a chunk of the above code:

    [removed]
                stepcarousel.setup({
                    galleryid: 'gallerya', //id of carousel DIV
                    beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
                    panelclass: 'panel', //class of panel DIVs each holding content
                    autostep: ,
                    panelbehavior: ,
                    defaultbuttons: ,
                    contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
                })
            
            [removed]

    Any help in how I can have it render properly would be great.

  • #2 / Jun 24, 2011 3:12pm

    Hyun Lee

    39 posts

    By the way my installation is v2.2.0 / Build:  20110622.

  • #3 / Jun 25, 2011 12:00am

    Bransin

    157 posts

    I’m experiencing the same. http://ellislab.com/forums/viewthread/192410/

  • #4 / Jun 27, 2011 1:31am

    Marcus Neto

    1005 posts

    Hyun,

    One of the things that may be happening is EE is trying to parse the {} tags in your Javascript.

    Is that code in a javascript template or an HTML template? If it is in an HTML template try moving it out to a JS template and embedding it in the original template. That may solve the problem.

  • #5 / Jun 27, 2011 3:52am

    narration

    773 posts

    Hyun, please check your system/expressionengine/config/config.php to see if you have debug there set to zero:

    $config['debug'] = "0";

    If this is your setting, EE will clear all curly-bracket values remaining after its own parsing. Thus Javascript items such a yours will disappear.

    Many of us consider this a (serious) bug, but Ellis doesn’t yet agree, so it is in the Feature Requests.

    Changing the value for debug to “1” in the config.php file will allow your Javascript to be output unchanged, if this is the source of your problem.

    Regards, hago annyoung-hi kyesipsio,
    Clive

  • #6 / Jun 27, 2011 9:24am

    Hyun Lee

    39 posts

    Narration, as per your suggestion changing it to

    $config['debug'] = "1";

    allows my ee templates to render the javascript containing the curly braces properly now. Thank you!!!

  • #7 / Jun 27, 2011 7:33pm

    Brandon Jones

    5500 posts

    Thanks Clive!

    Glad that worked, Hyun. Don’t hesitate to start a new thread if anything else pops up.

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

ExpressionEngine News!

#eecms, #events, #releases