Jun -

Your main problem appears to be that you are not allowed to do cross-site 
scripting.  All proper browsers block this since it is a major security hole.  


In particular, you cannot specify a domain in the XMLHttpRequest that is 
different from the domain of the page running the script.  In order to 
implement 
this restriction with certainty, the browsers generally prohibit the inclusion 
of any part of the URL up to and including the domain.

Your example is not complete enough for me to use your example (you put XXXXX), 
but in my case I must replace

    req.open("GET", "http://www.wisen.us/cgi-bin/Data.pl?deviceid=1234",true);

with

    req.open("GET", "/cgi-bin/Data.pl?deviceid=1234",true);

and ensure that my HTML page is located at some variant of

    http://www.wisen.us/.../index.html

I hope this helps.

Brian




________________________________
From: jun <[email protected]>
To: iPhoneWebDev <[email protected]>
Sent: Tue, November 2, 2010 5:04:24 AM
Subject: not access to webservice from safari

Hi.I'm new.
I want to access to my webservice from Safari on iPad.
My WebService is performed by WCF+OData.
First,I tried from Safari(Ver.5.0.2.) on local PC using
XMLHttpRequest,
but caught the following error at XMLHttpRequst.open() method.

status: Error: INVALID_STATE_ERR: DOM Exception 11

My javascript source is below.
if( window.XMLHttpRequest ){
        var xhr = new XMLHttpRequest();
        xhr.open( "GET", "http://XXXXXXXX";, true );
        xhr.onreadystatechange = function(){
            if( xhr.readyState == 4 && xhr.status == 200 ){
                alert( xhr.responseText );
            }
        }
        xhr.send( null );
}

I looked into the cause of this error,but I couldn't solve.
Please help me.

regards

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to