Does something like CURL exist in JavaScript?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Does something like CURL exist in JavaScript?

Post by nutkenz »

I need to scrape a page, but from the client's IP address. Is it possible to implement this using JavaScript?
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Does something like CURL exist in JavaScript?

Post by JAB Creations »

This sounds questionable at best and unnecessary unless you really have a good reason to do so.
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Re: Does something like CURL exist in JavaScript?

Post 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.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Does something like CURL exist in JavaScript?

Post 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).
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Re: Does something like CURL exist in JavaScript?

Post 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...
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Does something like CURL exist in JavaScript?

Post 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.
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Re: Does something like CURL exist in JavaScript?

Post by nutkenz »

Anyone know if there's a function built into AIR or something to make this possible?
Post Reply