jquery - Triggering 'onload' behavior in AJAX return data -
A friend and I are looking at a website that creates an AJAX phone that loads the HTML on a successful return Does the specified DIV tag and a Javascript function call. The problem is that it will only work twice, after clicking twice it fails to work properly. We are trying to dynamically control what is the function implemented ().
Here is a simple matter:
& lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" src = "jquery-1.4.1.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ("# trigger"). Click (function () {$ ("# target"). Load ('load.html');});}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "target" style = 'width: 200px; Height: 200px; Limit: 1 px solid black '& gt; Not loaded & lt; / Div & gt; & Lt; Input type = "button" value = "load ajax" id = "trigger" /> & Lt; / Body & gt; & Lt; / Html & gt;
load.html includes:
& lt; Script type = "text / javascript" & gt; $ (Function () {alerts ('loaded goods');}); & Lt; / Script & gt; Loaded
Here's the sample:
Thanks! Edit load.html
forgot to enter information about the contents of the event module A huge rewrite is included.
Comments
Post a Comment