 | 
September 2nd, 2008, 08:16 AM
| | Member | | Join Date: Aug 2007
Posts: 109
| | uncaught exception: permission denied to call XmlHttpRequest.open
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
| 
September 2nd, 2008, 05:12 PM
|  | Moderator | | Join Date: May 2007 Location: Munich, Germany Age: 36
Posts: 3,448
| |
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
| 
September 5th, 2008, 06:56 AM
| | Member | | Join Date: Aug 2007
Posts: 109
| |
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 - var xmlHttp = null;
-
if (window.XMLHttpRequest) {
-
// If IE7, Mozilla, Safari, and so on: Use native object.
-
xmlHttp = new XMLHttpRequest();
-
}
-
else
-
{
-
if (window.ActiveXObject) {
-
// ...otherwise, use the ActiveX control for IE5.x and IE6.
-
xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
-
}
-
}
-
Is it correct what i am doing please give me solution.
thanks
Last edited by gits; September 5th, 2008 at 08:24 AM.
Reason: added code tags
| 
September 5th, 2008, 08:26 AM
|  | Moderator | | Join Date: May 2007 Location: Munich, Germany Age: 36
Posts: 3,448
| |
was i correct with the assumption that you want to make cross-domain requests?
| 
September 5th, 2008, 08:46 AM
|  | Member | | Join Date: Oct 2007 Location: Shanghai Age: 22
Posts: 102
| |
I quite agree with gits. You probably want to make a cross-domain requests. Could you post more code for detail?
| 
September 6th, 2008, 07:13 AM
| | Member | | Join Date: Aug 2007
Posts: 109
| |
here with i am sending my full source code - <?php
-
-
?>
-
-
<html>
-
<head>
-
<script type="text/javascript" src="config_js_var.js"></script>
-
<script type='text/javascript'>
-
-
var xmlHttp
-
-
function get_username()
-
{
-
xmlHttp=GetXmlHttpObject()
-
if (xmlHttp==null)
-
{
-
alert ("Browser does not support HTTP Request")
-
return
-
}
-
var url=getldap_username_utility_url;
-
xmlHttp.onreadystatechange=getusername;
-
xmlHttp.open("GET",url,true)
-
xmlHttp.send(null)
-
}
-
function getusername()
-
{
-
var username;
-
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
-
{
-
usernamestring=xmlHttp.responseText
-
-
userarr = usernamestring.split("<!");
-
-
domainusername = userarr[0];
-
-
domainuserarr = domainusername.split("\\");
-
-
username = domainuserarr[1];
-
domain = domainuserarr[0];
-
var params;
-
-
-
-
params = "user="+username;
-
-
-
window.location=feedbackforum_url+"?user="+username+"&domainname="+domain;
-
}
-
}
-
-
-
function GetXmlHttpObject()
-
{
-
var xmlHttp=null;
-
try
-
{
-
// Firefox, Opera 8.0+, Safari
-
xmlHttp=new XMLHttpRequest();
-
}
-
catch (e)
-
{
-
//Internet Explorer
-
try
-
{
-
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
-
}
-
catch (e)
-
{
-
xmlHttpn=new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
}
-
return xmlHttp;
-
}
-
-
-
</script>
-
-
</head>
-
-
<body onload='get_username();'>
-
-
</body>
-
</html>
Last edited by gits; September 6th, 2008 at 07:52 AM.
Reason: added code tags
| 
September 6th, 2008, 01:06 PM
|  | Member | | Join Date: Oct 2007 Location: Shanghai Age: 22
Posts: 102
| |
Hi, would you please tell me the value of "getldap_username_utility_url" ?
| 
September 6th, 2008, 01:21 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
You can use a web proxy for cross-domain requests. Another alternative is a dynamic script tag.
| 
September 6th, 2008, 05:16 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
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.
|  | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,248 network members.
|