Note that there are some explanatory texts on larger screens.

plurals
  1. PORest webservice call for chrome browser
    primarykey
    data
    text
    <p>My first post Im trying to call a rest webservice to populate my lov's dynamically using AJAX. It works fine for me in IE8 but not in chrome. I couldn't reach a particular line while executing that I mentioned in the below code. Am i missing anything. Please help.</p> <p>07-24-2012 - I found the root cause for this issue. Its because of the application cache code specified in the html code. once i remove that the ajax call works fine. But my need is to make this page available in offline mode. Any suggestion on this to make the page available offline and also the ajax webservice calls works fine?. Thanks,</p> <pre><code>&lt;script type="text/javascript"&gt; var eleCount; var xmlDoc; function init() { eleCount =0; } function populate() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari alert("Window for chrome"); xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 alert("Else Window for IE"); xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; } var url = "http://localhost:7101/Mobile-MobileModel-context- root/jersey/Search/searchLov"; xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200){ var det = xmlhttp.responseText ; if (window.DOMParser) { //I cannot reach this line while executing. alert("This alert is not appearing"); var parser=new DOMParser(); xmlDoc=parser.parseFromString(det,"text/xml"); var x=xmlDoc.getElementsByTagName("fieldValue"); var txta =new Array(); ....some code } } else // Internet Explorer { alert("else window DOM parser for IE"); xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.loadXML(det); ...... some code } // end for } //end else for Other Browser (window.DOMParser) } //end if Readystate 4 and Status 200 else{ }//else }//close OnReadyStatechange Function xmlhttp.open('GET',url,true); xmlhttp.send(null); eleCount = eleCount + 1; }//end Function Populate() &lt;/script&gt; </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.
 

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