Bug Tracker

Modify

Ticket #1959 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

"strings are automatically evaluated" - NOT!

Reported by: djot Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: automatic evalscript Cc:
Blocking: Blocked by:

Description

- Hi,

quote from:  http://docs.jquery.com/Release:jQuery_1.2 "$(...).evalScripts() This method is no longer necessary in jQuery - all scripts included in HTML strings are automatically evaluated when injected into the document. No substitute method is needed."

if you have this, the click event gets bound (works).

any html/text <span id="foo">bar</span> any html/text
$(document).ready(function(){
$("#foo").click(...
});

if you do it the other way round, the event does not get bound (does not work):

$(document).ready(function(){
$("#foo").click(...
});
any html/text <span id="foo">bar</span> any html/text

I am not sure if this is a feature, for me it's a bug.

djot -

Change History

comment:1 Changed 6 years ago by djot

forget to mention that my codeblocks shown above are delivered by ajax responses ...

comment:2 Changed 6 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to duplicate

This is essentially a duplicate of #1884.

comment:3 Changed 6 years ago by davidserduke

  • Status changed from closed to reopened
  • Resolution duplicate deleted

Sorry, on closer examination this actually wasn't a close enough duplicate so I'm reopening it.

comment:4 Changed 6 years ago by davidserduke

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed in [4094]. Now all scripts are postponed till after the html is inserted. Unfortunately, $(document).ready() doesn't work with html insertion so at this time it makes sense to postpone all script evaluation since some of them (depending on where they are in the html) have to be postponed anyway. This gives the most consistent results.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.