HTML5 XMLHttpRequest Wrapper
Monkey Forums/Monkey Code/HTML5 XMLHttpRequest Wrapper
| ||
i've created a small XMLHttpRequest Wrapper. It works with Firefox, Chrome and IE. I have not tested other browsers yet. Demo: http://sedm.de/monkey/nettest/ Module: http://sedm.de/monkey/nettest/jnet.zip Sample: Methodlist of the class "XMLHttpRequest": have fun! |
| ||
Nice, thanks. |
| ||
Changes: the getter methods are now fields, like in the original XMLHttpRequest object. Additions: jNet now has a Flash-Target. Flash Example at : http://sedm.de/monkey/nettest/MonkeyGame.html |
| ||
Thanks a lot bruZard! very useful :) could you please explain a little more how it works, for newbies? :P thanks again! |
| ||
jNet is abandoned, use utils instead: http://www.sedm.de/monkey/utils.zip 1. create a new Object from XMLHttpRequest Local xhr:XMLHttpRequest = new XMLHttpRequest() 2. open a HTTP Connection to a URL xhr.open("google.com", "GET") ' GET is default, you can also use "POST" 3. send the request xhr.send() 3. wait for the answer If xhr.responseText.Length() doAnythingWithTheAnswer() on Android you must set the correct permission to access the internet! Remind that not all ISP's allows XMLHttpRequest. preferably you should use it on the same Domain to get Highscores, load Data (like Leveldata) etc. |
| ||
thanks!! ;) |
| ||
Nice thank you |
| ||
Thanks for providing this, but JFYI I noticed a very slight issue. The equal sign was missing below, and the compiler was complaining about missing identifier for the function. I'm using v53. #if TARGET "html5" Function Include:Void(url:String) = "utils_include" #EndIf Do you mind to please check & update it? Also I feel a bit silly, but though I comment out the above, and tried your original jnet code, I could never get a response in either case. All I could get was 'undefined' as a response. Do you have a suggestion? Thanks. |
| ||
Thanks for providing this, but JFYI I noticed a very slight issue. The equal sign was missing below, and the compiler was complaining about missing identifier for the function. I'm using v53. #if TARGET "html5" Function Include:Void(url:String) = "utils_include" #EndIf Do you mind to please check & update it? Also I feel a bit silly, but though I comment out the above, and tried your original jnet code, I could never get a response. All I could get was 'undefined'. Do you have a suggestion? Thanks. |
| ||
Sorry about the double post - not sure how it happened. I updated my original post a couple of times to include code formatting, but it seems to have duplicated my post after that. |
| ||
i've not looked at the utils module for a long time. Will try to clean it up |
| ||
has anyone still got a copy of this module? I have some historic code that used it but now dont have the module! |
| ||
httprequest is part of Monkey now, the module is in the brl folder and there is an example in mak's bananas folder. |
| ||
the XMLHttpRequest module is part of the utils module. I dont know if it work: http://www.colorflow.de/monkey/downloads/utils.zip |
| ||
Funny, I was desperately searching for something like this I guess... Thanks |