how to access cross domain using JSON ajax

acess , json , cross domains Birmingham, United Kingdom
  • 11 years ago

    hello

    Question:

    i get "Access denied" error.Can anyone convert the code below in JSON i need to access data from some other domain. OR any other fully explained efficient method to access cross domains plz.

    ---------js file--------------

    window.onload=makeRequest;

    function makeRequest() { var httprequest={};
    if (window.XMLHttpRequest) { // Mozilla, Safari,... http
    request = new XMLHttpRequest(); } else { http_request=new ActiveXObject("Msxml2.XMLHTTP");
    }

        http_request.open("GET", "http://www.uclocal.com/LX-U.aspx?", false);
        http_request.onreadystatechange=function()
        {
            if(http_request.readyState==3)
            {
            alert("data is loading...please wait");
            }
            else
            if(http_request.readyState==4)
            {
                if(http_request.status==200)
                {
                    document.write(http_request.responseText);
                }
            }       
         }    
        http_request.send();
    

    }

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie