Note that there are some explanatory texts on larger screens.

plurals
  1. POCall jQuery script located at server (and referanced by client) works on IE not FF and not Chrome
    primarykey
    data
    text
    <p>I have the following situation, i have a service project (ASMX) and a web project (ASPX) which i run localy on ASP.NET Development Server.</p> <p>I have a jQuery script that contain a handfull of functions which is calling the local asmx service (hence, the jQuery script is on the service project /Scripts - doing some database insertion and update.</p> <p>on my client page i referance the following:</p> <pre><code> //Referance from client &lt;script src="Scripts/jquery-1.3.1.js" type="text/javascript"&gt;&lt;/script&gt; //Referance from service project &lt;script src="http://localhost:4000/Scripts/Default.js" type="text/javascript"&gt;&lt;/script&gt; //Referance from client &lt;script src="Scripts/Caller.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>using the caller.js i should be able to call Default.js functions without cross-domain issues as the file is located beside the service. Which is working but only in IE7 and IE8. however in Chrome and FireFox 3 it didn't work returing the following exception:</p> <p>[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: <a href="http://localhost:4906/Scripts/jquery-1.3.1.js" rel="nofollow noreferrer">http://localhost:4906/Scripts/jquery-1.3.1.js</a> :: anonymous :: line 3511" data: no]</p> <p>and on FireBug i get: <strong>Access to restricted URI denied" code: "1012</strong></p> <p>After some googling this turn'ed out related to some Security Model - Cross-Domain blocking, which is weird as it works on IE and i don't think i am doing any Cross-Domain here as mentioned above the default.js (Which contains the calls to service) is located on the service project/server.</p> <p><strong>Summery: When referancing a script file that is located on the server any calls from a client that referance that file producing this error.</strong></p> <p>My Ajax Call is below: function PingJSON(fname,lname,family) { //Preparing Parameters and output var id='empty_response'; var params = "{x:'" + fname + "',y:'" + lname+ "',z:'"+ family + "'}";</p> <pre><code>//jQuert Ajax Call $.ajax({ type: "POST", url: "http://localhost:4000/MyService.asmx/PingService", data: params , timeout: 10000, async:false, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { //Success callback function id = msg; }, error: function(xhr, ajaxOptions, thrownError) { //Fail callback function alert(xhr.status); alert(thrownError); } }); return id; </code></pre> <p>};</p>
    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.
 

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