jQuery functionality not propagating to all areas of page

damianzaremab4

New Member
I'm using the 'timepickr' jQuery function, the problem is it works ok in the main webpage, however when I invoke it through an AJAX call, the funcionality is non-existant. The input box is displayed fine, but the mouseover funcionality isn't there. Code I'm using as follows....This is the page that contains the "div2" div: Note, the invocation of the timepickr jQuery thing works fine.\[code\]<head><link rel="Stylesheet" media="screen" href="http://stackoverflow.com/questions/3777547/reset.css" /> <link rel="Stylesheet" media="screen" href="http://stackoverflow.com/questions/3777547/styles.css" /> <link rel="Stylesheet" media="screen" href="http://stackoverflow.com/questions/3777547/ui.core.css" /> <link rel="Stylesheet" media="screen" href="http://stackoverflow.com/questions/3777547/ui.timepickr.css" /> <link rel="stylesheet" media="screen" href="http://stackoverflow.com/questions/3777547/jquery.timepickr.css" type="text/css" /> <SCRIPT LANGUAGE="JavaScript" SRC="http://stackoverflow.com/questions/3777547/js/timepicker.js"></SCRIPT> <script type="text/javascript" src="http://stackoverflow.com/questions/3777547/js/jquery.js"></script> <script type="text/javascript" src="http://stackoverflow.com/questions/3777547/js/showDiv2Contents.js"></script> <script type="text/javascript" src="http://stackoverflow.com/questions/3777547/js/jquery.ui.all.js"></script> <script type="text/javascript" src="http://stackoverflow.com/questions/3777547/js/jquery.timepickr.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".timepickr").each(function(){ $(this).timepickr(); })});</script> </head><body><div id="div1"><input class='timepickr' type='text' value='http://stackoverflow.com/questions/3777547/09:00' /><br> <!-- This works fine --></div><select onchange="showDiv2Contents(this.value)"> <option value='http://stackoverflow.com/questions/3777547/0' selected>1</option> <option value='http://stackoverflow.com/questions/3777547/1'>2</option></select><div id="div2"></div></body>\[/code\]When the dropdown box's state is changed, the showDiv2Contents js function is called, as follows:\[code\]function showDiv2Contents(){ if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("div2").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","testajax2.php",true); xmlhttp.send();}\[/code\]...and the "testajax2.php" is as follows...\[code\]<?phpecho "<br><br><br>";echo "Contents of Div2:";echo "<br><br><br>";echo "<input class='timepickr' type='text' value='http://stackoverflow.com/questions/3777547/09:00'/>"; //This doesn't work?>\[/code\]While the contents of testajax2.php is displayed fine, the timepickr functionality is non-existant. Any ideas? Thanks so much in advance,Mike
 
Back
Top