Skip to content Skip to sidebar Skip to footer

CUrl Converting Into Javascript Possible?

is there a way to convert this into javascript?

Solution 1:

Pure JavaScript? No.

JavaScript with a standard browser environment? Maybe. There is the XHR object (which includes the status property, which will tell you if it was successful or not), but there is also the same origin policy.


Solution 2:

Not directly. You can use XMLHttpRequest to download webpages, but there are cross-domain issues to be aware of.


Solution 3:

You can't but you can:

Actually you can save the php code to, let's say, mycurl.php, in your server, then use AJAX (XMLHttpRequest) to pass the url to mycurl.php and get back the response to your javascript function.


Post a Comment for "CUrl Converting Into Javascript Possible?"