By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

uncaught exception: permission denied to call XmlHttpRequest.open

100+
P: 121
hello

I am using xmlHttpRequest method in my application, this method is giving problem in the following browsers

1) Internet Explorer 7
2) Mozila Firefox(2.0.0.16)

I got solution for Mozilla issue

let me explain what i did

In the about:config (for this we have to open browser and type in the address bar as about:config, after that in filter place type as signed) of mozilla brower
you need to set 'signed.applets.codebase_principal_support' to true and add the line

'netscape.security.PrivilegeManager.enablePrivileg e("UniversalBrowserRead");

in my script(means above xmlHttpRequest.open)

But I am facing this issue in IE7 there i am getting Permission Denied to open xmlHttpRequest.

Anybody knows solution for this problem
Sep 2 '08 #1
Share this Question
Share on Google+
8 Replies


gits
Expert Mod 5K+
P: 5,390
i guess you want to start a 'cross-domain-request'? it is generally a very! bad idea to rely on settings to a browser-config ... unless it is an intranet application. you may probably find this helpful?

kind regards
Sep 2 '08 #2

100+
P: 121
hello,

Thanks for ur reply, i saw the url what u provided in the message

and i added the following below lines in my code but its still not working

Expand|Select|Wrap|Line Numbers
  1. var xmlHttp = null;
  2. if (window.XMLHttpRequest) {
  3.   // If IE7, Mozilla, Safari, and so on: Use native object.
  4.   xmlHttp = new XMLHttpRequest();
  5. }
  6. else
  7. {
  8.   if (window.ActiveXObject) {
  9.      // ...otherwise, use the ActiveX control for IE5.x and IE6.
  10.      xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
  11.   }
  12. }
  13.  
Is it correct what i am doing please give me solution.

thanks
Sep 5 '08 #3

gits
Expert Mod 5K+
P: 5,390
was i correct with the assumption that you want to make cross-domain requests?
Sep 5 '08 #4

Ferris
100+
P: 101
I quite agree with gits. You probably want to make a cross-domain requests. Could you post more code for detail?
Sep 5 '08 #5

100+
P: 121
here with i am sending my full source code

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. ?>
  4.  
  5. <html>
  6. <head>
  7. <script type="text/javascript" src="config_js_var.js"></script>
  8. <script type='text/javascript'>
  9.  
  10. var xmlHttp
  11.  
  12. function get_username()
  13. {
  14.     xmlHttp=GetXmlHttpObject()
  15.     if (xmlHttp==null)
  16.      {
  17.         alert ("Browser does not support HTTP Request")
  18.          return
  19.      }
  20.     var url=getldap_username_utility_url;
  21.     xmlHttp.onreadystatechange=getusername;
  22.     xmlHttp.open("GET",url,true)
  23.     xmlHttp.send(null)
  24. }
  25. function getusername()
  26. {
  27.     var username;
  28.     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  29.     {
  30.          usernamestring=xmlHttp.responseText
  31.  
  32.         userarr = usernamestring.split("<!");
  33.  
  34.         domainusername = userarr[0];
  35.  
  36.         domainuserarr = domainusername.split("\\");
  37.  
  38.         username = domainuserarr[1];
  39.         domain = domainuserarr[0];
  40.         var params;
  41.  
  42.  
  43.  
  44.         params = "user="+username;
  45.  
  46.  
  47.         window.location=feedbackforum_url+"?user="+username+"&domainname="+domain;
  48.     }
  49. }
  50.  
  51.  
  52. function GetXmlHttpObject()
  53. {
  54.     var xmlHttp=null;
  55.     try
  56.      {
  57.          // Firefox, Opera 8.0+, Safari
  58.          xmlHttp=new XMLHttpRequest();
  59.      }
  60.     catch (e)
  61.      {
  62.          //Internet Explorer
  63.          try
  64.           {
  65.               xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  66.           }
  67.          catch (e)
  68.           {
  69.               xmlHttpn=new ActiveXObject("Microsoft.XMLHTTP");
  70.           }
  71.     }
  72.     return xmlHttp;
  73. }
  74.  
  75.  
  76. </script>
  77.  
  78. </head>
  79.  
  80. <body onload='get_username();'>
  81.  
  82. </body>
  83. </html>
Sep 6 '08 #6

Ferris
100+
P: 101
Hi, would you please tell me the value of "getldap_username_utility_url" ?
Sep 6 '08 #7

acoder
Expert Mod 15k+
P: 16,027
You can use a web proxy for cross-domain requests. Another alternative is a dynamic script tag.
Sep 6 '08 #8

acoder
Expert Mod 15k+
P: 16,027
I'll just point out that dynamic script tags are for JavaScript/JSON only, so may not be useful here. One other alternative is Apache's mod_rewrite, if that's possible.
Sep 6 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.