jQWidgets Forums

jQuery UI Widgets Forums Layouts Splitter Huge bug! scripts in panels run twice!

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Huge bug! scripts in panels run twice! #7311

    spetsnaz
    Member

    Hey there,

    If you place a sample script code inside panel blocks, the splitter plugin makes those code to run twice.

    Lets modify vertical-splitter.htm in demo/ folder with this and see, you will see 2 alert messages. I think the plugin clones the whole wrapper into splitter structure so this causes javascripts to be run another time. How to fix this bug?

    Panel 1

    $(document).ready(function () {
    alert(‘A’);
    });

    Panel 2

    Huge bug! scripts in panels run twice! #7315

    Peter Stoev
    Keymaster

    Hi spetsnaz,

    This is not a bug. You shouldn’t add a script inside a panel of a Splitter. The splitter defines a wrapper when it is initialized i.e an additional DIV tag is inserted into the DOM and this will cause a script defined in an inner DIV tag like the panel to run twice. The better option is after the initialization of the Splitter to add dynamically content or do something else depending on your application scenario.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.