I used jquery tabs, and by clicking in one tab I loaded page via ajax. I edited the loaded page by javascript and added some html elements (nested list). I tried to load this elements by jquery using load() function in other php page so can I represent these nested list in chart, but it didn’t load any thing. If I tried to load static elements it worked. I tried to load from the main file which contains the tabs and tried the loaded file. it doesn’t work
I hope that my question is clear, and any help I appreciate it.
According to the API, you can pass back script tags with the HTML and jQuery will execute the script (see the dataType section.) But, in practice, I’ve found this to not work all the time. I find jQuery is fussy about embedding JavaScript in HTML on ajax calls. You really have to do one or the other, or else handle the javascript on your own using eval statements.
NOTE: When jQuery does get it right, I believe it is still using eval() calls, which is not efficient.
The proper approach is to keep your javascript in your javascript files. In your first jQuery .load statement, use onComplete to call the .load…