I'm wondering if anyone has come across any libraries in javascript that can emulate something like php's cURL?
-
At least for in-browser JavaScript, cross-domain rules will make that of limited use. And is it much different from an XmlHttpRequest anyway?Thilo– Thilo2010-09-27 03:14:32 +00:00Commented Sep 27, 2010 at 3:14
-
Why yes... jQuery can do pretty much everything cURL can.JAL– JAL2010-09-27 03:15:16 +00:00Commented Sep 27, 2010 at 3:15
Add a comment
|
3 Answers
Not possible as the browser sandbox doesn't allow you to make TCP sockets directly. You're limited to the options given by XmlHTttpRequest. You'd need a server-side proxy script to do what you want. Or use flash/java which gives you more options regarding connectivity. Still restricted to the same domain I believe though.
1 Comment
Yvonne Aburrow
This is the only explanation I have seen of why JavaScript doesn't use cURL. Thanks.