[slscripters] jQuery problems calling into SL

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[slscripters] jQuery problems calling into SL

Sasun Steinbeck
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] jQuery problems calling into SL

Darien Caldwell-2
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] jQuery problems calling into SL

Marc Adored
use success() instead of done() see if that helps. jQuery works fine and is very reliable, no reason to do things the hard way like Dari suggests :P


On Fri, May 17, 2013 at 1:48 AM, Darien Caldwell <[hidden email]> wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] jQuery problems calling into SL

Fred Beckhusen
In reply to this post by Darien Caldwell-2
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

[slscripters] Fwd: Re: jQuery problems calling into SL

Sgeo-2
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Fwd: Re: jQuery problems calling into SL

Frans-5
I guess to circumvent the security, write seperate backend code (php/asp) that connects to SL and returns the values to your javascript.

Frans


On Fri, May 17, 2013 at 6:32 PM, Sgeo <[hidden email]> wrote:
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] jQuery problems calling into SL (Ferd Frederix)

Fred Beckhusen
In reply to this post by Sgeo-2
Anybody have a working example?

  I tried this years ago, and could not get around LSL not returning the
MIME type application/JSON. Without it, the JSON data wrapped by the
JSONP function call was still treated as a block, and not a function.  
Perhaps an eval is used to get around that?

Ferd Frederix





_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] jQuery problems calling into SL (Ferd Frederix)

Kelly Linden
llSetContentType now supports setting a return content type of application/json for http-in (http_request event), as well as some xml formats. The following new constants correspond to these content types:
  • CONTENT_TYPE_XML: application/xml
  • CONTENT_TYPE_XHTML: application/xhtml+xml
  • CONTENT_TYPE_ATOM: application/atom+xml
  • CONTENT_TYPE_JSON: application/json
  • CONTENT_TYPE_LLSD: application/llsd+xml
  • CONTENT_TYPE_FORM: application/x-www-form-urlencoded
  • CONTENT_TYPE_RSS: application/rss+xml

On the flip side llHTTPRequest is able to fetch those content types as well.

http://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/13#13.04.29.274986

 - Kelly

On Fri, May 17, 2013 at 9:54 AM, Fred Beckhusen <[hidden email]> wrote:
Anybody have a working example?

  I tried this years ago, and could not get around LSL not returning the
MIME type application/JSON. Without it, the JSON data wrapped by the
JSONP function call was still treated as a block, and not a function.
Perhaps an eval is used to get around that?

Ferd Frederix





_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Fwd: Re: jQuery problems calling into SL

Marc Adored
In reply to this post by Frans-5
You can send crossdomain information in LSL aka the CORS stuff Sgeo mentions. Sorry I didn't think about that. Just send the "Access-Control-Allow-Origin: http://yourdomain.com" header.


On Fri, May 17, 2013 at 12:53 PM, Frans <[hidden email]> wrote:
I guess to circumvent the security, write seperate backend code (php/asp) that connects to SL and returns the values to your javascript.

Frans


On Fri, May 17, 2013 at 6:32 PM, Sgeo <[hidden email]> wrote:
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Fwd: Re: jQuery problems calling into SL

Darien Caldwell-2
I don't know what's hard about my code. :) Just paste it in and go, same as JQuery.  If *all* you're doing is AJAX, JQuery is a big payload for a  simple function.
But yeah it would be nice if JQuery actually worked. If you get it to actually work, please update here :)
 
It's somewhat true about Cross Site, I was using IE 10 last night and it doesn't seem to care, which is why it worked for me. Sure enough failed in Chrome.


On Fri, May 17, 2013 at 10:21 AM, Marc Adored <[hidden email]> wrote:
You can send crossdomain information in LSL aka the CORS stuff Sgeo mentions. Sorry I didn't think about that. Just send the "Access-Control-Allow-Origin: http://yourdomain.com" header.


On Fri, May 17, 2013 at 12:53 PM, Frans <[hidden email]> wrote:
I guess to circumvent the security, write seperate backend code (php/asp) that connects to SL and returns the values to your javascript.

Frans


On Fri, May 17, 2013 at 6:32 PM, Sgeo <[hidden email]> wrote:
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Fwd: Re: jQuery problems calling into SL

Sasun Steinbeck
Ok I've learned a few things and tried some more tests... I'm setting a custom header (which I should have done for a proper CORS request) so now my browser is sending out what looks like a correct pre-flight request:

OPTIONS /cap/9d00f7c6-893a-f878-6f1f-0c9202ffd7c3 HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Origin: http://localhost:60779
Access-Control-Request-Method: POST
Access-Control-Request-Headers: my-token
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

however the reply from the SL server does not contain the necessary Access-Control-Allow-Origin (nor my Access-Control-Allow-Headers) and everything comes to a screeching halt:

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 20:40:08 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8o DAV/2
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 0
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/plain
X-Pad: avoid browser bug
_____

This really has nothing to do with jQuery since the request headers look OK to me... not that I'm the world's expert or anything, but there's just nothing that I can see that looks out of place.

So basically, the SL servers are simply not set up for CORS, or, if they are, I don't know what headers they are expecting to trigger the right response. It's apparently all up to how they have their web server configured.

So it looks like I'm back to doing this via proxy, which isn't a problem.




On Fri, May 17, 2013 at 11:14 AM, Darien Caldwell <[hidden email]> wrote:
I don't know what's hard about my code. :) Just paste it in and go, same as JQuery.  If *all* you're doing is AJAX, JQuery is a big payload for a  simple function.
But yeah it would be nice if JQuery actually worked. If you get it to actually work, please update here :)
 
It's somewhat true about Cross Site, I was using IE 10 last night and it doesn't seem to care, which is why it worked for me. Sure enough failed in Chrome.


On Fri, May 17, 2013 at 10:21 AM, Marc Adored <[hidden email]> wrote:
You can send crossdomain information in LSL aka the CORS stuff Sgeo mentions. Sorry I didn't think about that. Just send the "Access-Control-Allow-Origin: http://yourdomain.com" header.


On Fri, May 17, 2013 at 12:53 PM, Frans <[hidden email]> wrote:
I guess to circumvent the security, write seperate backend code (php/asp) that connects to SL and returns the values to your javascript.

Frans


On Fri, May 17, 2013 at 6:32 PM, Sgeo <[hidden email]> wrote:
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] Fwd: Re: jQuery problems calling into SL

Brent Tubbs
If CORS isn't working, I've had success using JSONP in the past.  https://bitbucket.org/btubbs/schmarchive is built on it.  Only supports Chrome and Firefox though.  I think IE chokes on the mimetype being text/plain instead of application/javascript.  It's been a while though.


On Fri, May 17, 2013 at 1:51 PM, Sasun Steinbeck <[hidden email]> wrote:
Ok I've learned a few things and tried some more tests... I'm setting a custom header (which I should have done for a proper CORS request) so now my browser is sending out what looks like a correct pre-flight request:

OPTIONS /cap/9d00f7c6-893a-f878-6f1f-0c9202ffd7c3 HTTP/1.1

Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us
Accept-Encoding: gzip, deflate
Origin: http://localhost:60779
Access-Control-Request-Method: POST
Access-Control-Request-Headers: my-token

Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

however the reply from the SL server does not contain the necessary Access-Control-Allow-Origin (nor my Access-Control-Allow-Headers) and everything comes to a screeching halt:

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 20:40:08 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8o DAV/2
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 0
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/plain
X-Pad: avoid browser bug
_____

This really has nothing to do with jQuery since the request headers look OK to me... not that I'm the world's expert or anything, but there's just nothing that I can see that looks out of place.

So basically, the SL servers are simply not set up for CORS, or, if they are, I don't know what headers they are expecting to trigger the right response. It's apparently all up to how they have their web server configured.

So it looks like I'm back to doing this via proxy, which isn't a problem.




On Fri, May 17, 2013 at 11:14 AM, Darien Caldwell <[hidden email]> wrote:
I don't know what's hard about my code. :) Just paste it in and go, same as JQuery.  If *all* you're doing is AJAX, JQuery is a big payload for a  simple function.
But yeah it would be nice if JQuery actually worked. If you get it to actually work, please update here :)
 
It's somewhat true about Cross Site, I was using IE 10 last night and it doesn't seem to care, which is why it worked for me. Sure enough failed in Chrome.


On Fri, May 17, 2013 at 10:21 AM, Marc Adored <[hidden email]> wrote:
You can send crossdomain information in LSL aka the CORS stuff Sgeo mentions. Sorry I didn't think about that. Just send the "Access-Control-Allow-Origin: http://yourdomain.com" header.


On Fri, May 17, 2013 at 12:53 PM, Frans <[hidden email]> wrote:
I guess to circumvent the security, write seperate backend code (php/asp) that connects to SL and returns the values to your javascript.

Frans


On Fri, May 17, 2013 at 6:32 PM, Sgeo <[hidden email]> wrote:
---------- Forwarded message ----------
From: "Sgeo" <[hidden email]>
Date: May 17, 2013 12:31 PM
Subject: Re: [slscripters] jQuery problems calling into SL
To: <[hidden email]>

Could have the server return JSONP if you don't mind the security concerns. I wonder if you can do CORS stuff from LSL

On May 17, 2013 11:13 AM, "Fred Beckhusen" <[hidden email]> wrote:
You can't get there from here without using the same server at the same domain to proxy the reads.   XMLHttpRequest - which both  elegant JQuery and low level Javascript use - cannot read from another domain.   It can write data, but cross site scripting (XSS) security rules prohibit the browser from returning a response from another domain.   

Ferd Frederix


On 5/17/2013 12:48 AM, Darien Caldwell wrote:
Well, this is one of the reasons I do not use JQuery's Ajax functions, even though I use other parts of it. They glom on way too much junk that tends to make it unreliable. using my own code, it works:
 
<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
     <script>
    var URL = "http://sim10338.agni.lindenlab.com:12046/cap/63ba5249-7516-856c-1cab-e97c19d42201";
 var req;
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
 req.open("POST", URL, true);
 req.send("hello");
function processReqChange()
{
   // If req shows "complete"
   if (req.readyState == 4)
   {
      // If "OK"
      if (req.status == 200)
      {
         alert(req.responseText);
      }
      else
      {
         // Flag error
         alert('There was a problem retrieving data: ' + req.statusText +' - '+ req.status );
      }
   }
}
    </script>
</body>
</html>
 
I do see one interesting thing about the reply from SL,
 
it's <html>world!</html>, which seems rather odd given the script doesn't set the content-type to HTML.
 
Note that the code above is only guaranteed to work for some browsers such as IE and Webkit (Chrome/Safari).  If you need a browser-agnostic solution, you'd have to add a lot more code, browser detection, etc (which is what JQuery is supposed to give you, too bad they Eff it up.)
 
 Hope this helps.
 
                  - Dari
 


On Thu, May 16, 2013 at 8:24 PM, Sasun Steinbeck <[hidden email]> wrote:
I'm having a heck of a time trying to get something that should be a simple. I'm trying to send a simple string to an LSL object from an external jQuery .ajax call. The call works, but I can't for the life of me get the response. This is easy to reproduce. Drop this LSL script into an inworld object, it will tell you it's URL. Copy and paste it in to the HTML below that and load the page in your browser.

Given this LSL:

string URL;

default
{
    state_entry()
    {
        llRequestURL();
    }

    http_request(key ID, string Method, string body)
    {
        if (Method == URL_REQUEST_GRANTED)
        {
            llOwnerSay("My URL: " + body);
            URL = body;
        }
        else if (Method == "POST")
        {
            llOwnerSay("request body: " + body);
            llHTTPResponse(ID, 200, "world!");
        }
    }
}

and this simple HTML test page:

<!DOCTYPE html>
<html>
<body>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
    <script>
<--COPY AND PASTE THIS FROM YOUR INWORLD OBJECT:-->
        var URL = "http://sim10309.agni.lindenlab.com:12046/cap/106075f6-caa2-59d0-9841-e2580483cf9c";
        $.ajax({
            url: URL,
            type: "POST",
            dataType: "text",
            contentType: "text/plain; charset=UTF-8",
            data: "hello",
        })
        .done(function (reply) {
            alert("success! " + reply);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
            var s = textStatus == null ? "" : textStatus;
            s += errorThrown == null ? "" : ", " + errorThrown;
            alert(s);
        });
    </script>
</body>
</html>

I'm getting a 200 status back but I'm just completely unable to get the response body back, the request fails. The request goes in, the script gets it, it replies back, but Firebug shows that the request got an error and a blank body for the return.
_____

Fiddler shows this. Here's the raw request:

POST /cap/3fc025d0-ddbf-0662-1379-bbebad2e892c HTTP/1.1
Host: sim10309.agni.lindenlab.com:12046
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/plain, */*; q=0.01
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Content-Type: text/plain; charset=UTF-8
Referer: http://localhost:60779/test.html
Content-Length: 5
Origin: http://localhost:60779
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
_____

here's the raw response from SL:
_____

HTTP/1.1 200 OK
Date: Fri, 17 May 2013 03:14:29 GMT
Server: Server: Second Life LSL/Second Life Server 13.05.04.275247 (http://secondlife.com)
Content-Length: 6
Cache-Control: no-cache, max-age=0
Content-Type: text/plain; charset=utf-8
Pragma: no-cache
X-SecondLife-Local-Position: (37.657642, 32.710564, 20.841444)
X-SecondLife-Local-Rotation: (0.000000, 0.000000, 0.000000, 1.000000)
X-SecondLife-Local-Velocity: (0.000000, 0.000000, 0.000000)
X-SecondLife-Object-Key: b87e8df2-5684-705a-e555-b37d31d90a38
X-SecondLife-Object-Name: HTTP tester
X-SecondLife-Owner-Key: c3cf4c84-c31b-47ac-855c-3858375e0360
X-SecondLife-Owner-Name: Sasun Steinbeck
X-SecondLife-Region: Vertigo (223488, 236800)
X-SecondLife-Shard: Production
Connection: close

world!
_____

You can see the response right there, and a good return code. What the heck am I doing wrong that causes jQuery to not see this as a valid response?

I've been able to successfully submit normal forms to inworld objects directly from a web page and get a response, this is the first time I've tried calling an inworld server with an ajax call. Help!


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters




--
Jeroen Frans
Virtual World Technology Specialist @ http://VesuviusGroup.com
Second Life: Frans Charming
blog about SL @ http://secondslog.blogspot.com

"The best way to predict the future is to invent it." Alan Kay

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters