Page 1 of 1
Does something like CURL exist in JavaScript?
Posted: Sat May 31, 2008 7:09 am
by nutkenz
I need to scrape a page, but from the client's IP address. Is it possible to implement this using JavaScript?
Re: Does something like CURL exist in JavaScript?
Posted: Sat May 31, 2008 1:23 pm
by JAB Creations
This sounds questionable at best and unnecessary unless you really have a good reason to do so.
Re: Does something like CURL exist in JavaScript?
Posted: Sat May 31, 2008 1:28 pm
by nutkenz
I realize that, but there's no malintent; it's just so users can access other webpages directly without straining my own server from within an AIR app.
Re: Does something like CURL exist in JavaScript?
Posted: Sun Jun 01, 2008 11:44 am
by kaszu
You can do it with iframe, but if you only need to get html, then you can do it with ajax (in responseText will be all html).
Re: Does something like CURL exist in JavaScript?
Posted: Sun Jun 01, 2008 1:22 pm
by nutkenz
Aren't there security issues when calling a URL which is not on the same domain? I'm relatively new to JS, when trying this:
Code: Select all
jQuery.get('http://google.com',null,function(data){alert(data);});
Nothing seems to happen...
Re: Does something like CURL exist in JavaScript?
Posted: Sun Jun 01, 2008 3:00 pm
by kaszu
Sorry, didn't thought about it.
Then only easy solution then will be iframe, but you won't be able to get content of the page for the same reason.
Re: Does something like CURL exist in JavaScript?
Posted: Sun Jun 01, 2008 3:08 pm
by nutkenz
Anyone know if there's a function built into AIR or something to make this possible?