deostroll Posted March 24, 2008 Share Posted March 24, 2008 Can javascript call out to a remote webservice so that we can display updated information like for e.g. a weather forecast in our normal html pages. Link to comment Share on other sites More sharing options...
Jesdisciple Posted March 24, 2008 Share Posted March 24, 2008 On your own server, yes... But I believe privileges are restricted when access to a 'third-party' server is attempted. See http://w3schools.com/AJAX/default.asp. Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted March 24, 2008 Share Posted March 24, 2008 You can use the PHP file() function to do that, I did to google.com! You can get the data as if you were viewing the source. Link to comment Share on other sites More sharing options...
Synook Posted March 24, 2008 Share Posted March 24, 2008 I don't think you can file() a web service though... you can use PHP's SOAP functions http://au2.php.net/manual/en/ref.soap.php Link to comment Share on other sites More sharing options...
Jesdisciple Posted March 24, 2008 Share Posted March 24, 2008 Erm... I'm not sure the OP wants to contact another server; that comment was just in case he did.We should probably wait for a reply from him before we start discussing an imaginary problem (then he comes back with questions and we're still trying to solve the imaginary problem). Link to comment Share on other sites More sharing options...
Synook Posted March 24, 2008 Share Posted March 24, 2008 remote webserviceThat means on another server, no? Link to comment Share on other sites More sharing options...
Jesdisciple Posted March 24, 2008 Share Posted March 24, 2008 JavaScript is on the client; the original server is remote from the client. Can we please wait for more details? Link to comment Share on other sites More sharing options...
Synook Posted March 24, 2008 Share Posted March 24, 2008 lol ok Link to comment Share on other sites More sharing options...
justsomeguy Posted March 24, 2008 Share Posted March 24, 2008 Can javascript call out to a remote webservice so that we can display updated information like for e.g. a weather forecast in our normal html pages.Unless he's running his own weather forecast server I'm pretty sure he's talking about pulling in remote data, in which case you would either need to use the SOAP functions or file_get_contents, but you would need to use a PHP AJAX proxy. So the AJAX page sends a request to a local PHP page (which is legal), and the PHP page sends the request for the remote data (which is also legal). You can use a function like file or file_get_contents if the URL wrappers for fopen are enabled. So PHP would get the remote data and forward it on to the AJAX response. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.