← Return to PHP Web Museum
Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorricardo
    • CommentTime22 hours ago
     
    jQuery 1.2.6. I have an alert() in $(document).ready and it shows up twice on one page only. Same script on every other page, only once. What should I look for?
    • CommentAuthorfloatleft
    • CommentTime22 hours ago
     
    Most common reason: jquery.js and your script are included twice. Check the page's view source, not the template. Sometimes a CMS widget adds its own copy.
    • CommentAuthorricardo
    • CommentTime21 hours ago
     
    No double includes. But the page has an iframe with the same layout in it (a print preview thing). Could that be it?
    • CommentAuthorfloatleft
    • CommentTime21 hours ago
     
    Yes, the iframe loads its own document and runs its own ready handler. If the alert is in a shared file it'll fire once per document.
    • CommentAuthorricardo
    • CommentTime20 hours ago
     
    That was it. I feel stupid. Thanks!
    • CommentAuthorjbaker
    • CommentTime4 hours ago
     
    For next time, console.log instead of alert, and Firebug shows which file and line it came from. Much faster to figure out than alerts.