Note that there are some explanatory texts on larger screens.

plurals
  1. POajax call does not fire jquery code
    primarykey
    data
    text
    <p>Hi In my script I am trying to call a page through ajax and then insert the contents of that page in the dom. The target page has this code: </p> <pre><code>&lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/highcharts.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var chart1; // globally available $(document).ready(function() { chart1 = new Highcharts.Chart({ chart: { renderTo: 'chart-container-1', defaultSeriesType: 'bar' }, title: { text: 'Fruit Consumption' }, xAxis: { categories: ['Apples', 'Bananas', 'Oranges'] }, yAxis: { title: { text: 'Fruit eaten' } }, series: [{ name: 'Jane', data: [1, 0, 4] }, { name: 'John', data: [5, 7, 3] }] }); }); &lt;/script&gt; &lt;/head&gt; &lt;div id="chart-container-1" style="width: 100%; height: 400px"&gt;&lt;/div&gt; </code></pre> <p>It is from highcharts script. When I make the ajax call I just get an empty div. Nonetheless when I run the page without the ajax call it runs just fine.</p> <p>EDIT: The page I am requesting contain jquery script, however I not using jquery script to call it. I am using these functions instead:</p> <pre><code>function callAHAH(url, pageElement, callMessage, errorMessage) { document.getElementById(pageElement).innerHTML = callMessage; try { req = new XMLHttpRequest(); /* e.g. Firefox */ } catch(e) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); /* some versions IE */ } catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); /* some versions IE */ } catch (E) { req = false; } } } req.onreadystatechange = function() {responseAHAH(pageElement, callMessage, errorMessage);}; req.open("GET",url,true); req.send(null); } function responseAHAH(pageElement, callMessage, errorMessage) { var output = ''; if(req.readyState == 4) { if(req.status == 200) { output = req.responseText; document.getElementById(pageElement).innerHTML = output; } else { document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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