Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Datepicker in AJAX page
    primarykey
    data
    text
    <p>I have 2 pages. 1 is the datepicker demo by jQuery and another is an AJAX page to load the datepicker demo page. When I access the datepicker page directly, the date selector is working fine as in the sample. But when I try to load it with an ajax call, the selector just seems not be working at all.</p> <p>Here is the main.php page code</p> <pre><code>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 &amp;&amp; xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","development-bundle/demos/datepicker/default.html",true); xmlhttp.send(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="myDiv"&gt;&lt;h2&gt;Let AJAX change this text&lt;/h2&gt;&lt;/div&gt; &lt;button type="button" onclick="loadXMLDoc()"&gt;Change Content&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is the datepicker page code (it's just the same demo code from jquery)</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;jQuery UI Datepicker - Default functionality&lt;/title&gt; &lt;link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"&gt; &lt;script src="../../jquery-1.6.2.js"&gt;&lt;/script&gt; &lt;script src="../../ui/jquery.ui.core.js"&gt;&lt;/script&gt; &lt;script src="../../ui/jquery.ui.widget.js"&gt;&lt;/script&gt; &lt;script src="../../ui/jquery.ui.datepicker.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="../demos.css"&gt; &lt;script&gt; $(function() { $( "#datepicker" ).datepicker(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="demo"&gt; &lt;p&gt;Date: &lt;input type="text" id="datepicker"&gt;&lt;/p&gt; &lt;/div&gt;&lt;!-- End demo --&gt; &lt;div class="demo-description"&gt; &lt;p&gt;The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.&lt;/p&gt; &lt;/div&gt;&lt;!-- End demo-description --&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I am really lost. The datepicker page just does not work together with the AJAX. Hope someone can help out here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload