0

there is a script what can run loaded javascript again?

My problem is when I load page by Ajax(jquery). And i load page to body. Content what was loaded is ok, but javascript dont run again.

Example: Page -> click button -> reload body content -> content is datatable and nothing more (javascript stay).

Is there any solutions for this problem ?

Richard Hutta
  • 659
  • 7
  • 12
  • 1
    If I understand you correctly, you will need to run your scripts again once the DOM has been updated. – powerbuoy Jun 26 '12 at 15:40
  • You can use the success callback function of jQuery.ajax to execute your JavaScript function again. – Jay Tomten Jun 26 '12 at 15:41
  • if you put them all in another function you can easily recall them when ever you need them. – scrappedcola Jun 26 '12 at 15:43
  • Did you check for a javascript error after everything loaded? I'm curious if javascript isn't running any longer because it hit an error. – Techgration Jun 26 '12 at 15:59
  • Thanks for comment, but the template have lots of script and do backcall for all will be suicide. :D – Richard Hutta Jun 26 '12 at 17:33
  • See this post: http://stackoverflow.com/questions/9723471/how-to-run-scripts-loaded-dynamically-with-javascript, phtrivier's answer in particular. – PoxBlossom Aug 20 '12 at 15:14

0 Answers0