uncaught exception: permission denied to call XmlHttpRequest.open

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbettadpur
    New Member
    • Aug 2007
    • 121

    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.1 6)

    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_princ ipal_support' to true and add the line

    'netscape.secur ity.PrivilegeMa nager.enablePri vilege("Univers alBrowserRead") ;

    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
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    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

    Comment

    • sbettadpur
      New Member
      • Aug 2007
      • 121

      #3
      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.XMLHttp Request) {
      // If IE7, Mozilla, Safari, and so on: Use native object.
      xmlHttp = new XMLHttpRequest( );
      }
      else
      {
      if (window.ActiveX Object) {
      // ...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; Sep 5 '08, 07:24 AM. Reason: added code tags

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5388

        #4
        was i correct with the assumption that you want to make cross-domain requests?

        Comment

        • Ferris
          New Member
          • Oct 2007
          • 101

          #5
          I quite agree with gits. You probably want to make a cross-domain requests. Could you post more code for detail?

          Comment

          • sbettadpur
            New Member
            • Aug 2007
            • 121

            #6
            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=GetXmlH ttpObject()
            if (xmlHttp==null)
            {
            alert ("Browser does not support HTTP Request")
            return
            }
            var url=getldap_use rname_utility_u rl;
            xmlHttp.onready statechange=get username;
            xmlHttp.open("G ET",url,true)
            xmlHttp.send(nu ll)
            }
            function getusername()
            {
            var username;
            if (xmlHttp.readyS tate==4 || xmlHttp.readySt ate=="complete" )
            {
            usernamestring= xmlHttp.respons eText

            userarr = usernamestring. split("<!");

            domainusername = userarr[0];

            domainuserarr = domainusername. split("\\");

            username = domainuserarr[1];
            domain = domainuserarr[0];
            var params;



            params = "user="+usernam e;


            window.location =feedbackforum_ url+"?user="+us ername+"&domain name="+domain;
            }
            }


            function GetXmlHttpObjec t()
            {
            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.XMLHT TP");
            }
            }
            return xmlHttp;
            }


            </script>

            </head>

            <body onload='get_use rname();'>

            </body>
            </html>[/CODE]
            Last edited by gits; Sep 6 '08, 06:52 AM. Reason: added code tags

            Comment

            • Ferris
              New Member
              • Oct 2007
              • 101

              #7
              Hi, would you please tell me the value of "getldap_userna me_utility_url" ?

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                You can use a web proxy for cross-domain requests. Another alternative is a dynamic script tag.

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  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.

                  Comment

                  Working...