Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 2nd, 2008, 08:16 AM
Member
 
Join Date: Aug 2007
Posts: 106
Default 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
Reply
  #2  
Old September 2nd, 2008, 05:12 PM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 36
Posts: 3,370
Default

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
Reply
  #3  
Old September 5th, 2008, 06:56 AM
Member
 
Join Date: Aug 2007
Posts: 106
Default

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

[CODE=javascript]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');
}
}
[/code]

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
Reply
  #4  
Old September 5th, 2008, 08:26 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 36
Posts: 3,370
Default

was i correct with the assumption that you want to make cross-domain requests?
Reply
  #5  
Old September 5th, 2008, 08:46 AM
Ferris's Avatar
Member
 
Join Date: Oct 2007
Location: Shanghai
Age: 22
Posts: 102
Default

I quite agree with gits. You probably want to make a cross-domain requests. Could you post more code for detail?
Reply
  #6  
Old September 6th, 2008, 07:13 AM
Member
 
Join Date: Aug 2007
Posts: 106
Default

here with i am sending my full source code

[CODE=php]<?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="+usernam e+"&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>[/code]

Last edited by gits; September 6th, 2008 at 07:52 AM. Reason: added code tags
Reply
  #7  
Old September 6th, 2008, 01:06 PM
Ferris's Avatar
Member
 
Join Date: Oct 2007
Location: Shanghai
Age: 22
Posts: 102
Default

Hi, would you please tell me the value of "getldap_username_utility_url" ?
Reply
  #8  
Old September 6th, 2008, 01:21 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,593
Default

You can use a web proxy for cross-domain requests. Another alternative is a dynamic script tag.
Reply
  #9  
Old September 6th, 2008, 05:16 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,593
Default

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.
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles