[jQuery] php - web service (ajax/jscript)

[jQuery] php - web service (ajax/jscript)

jake...
now i'm laughing!!!!
here's how i understand it with a very limited amont of time to research
this.
the basic ajax/jscript allows for asynch communications between the server
that serves the jscript file. cross-domain issues arise when you'd want the
ajax/jscript to not only communicate with the 'hosted'/parent server, but
also to another server's api as well, (with this server being in another
domain).
this is why in the html/php, you'll have the following kind of code:
<script>
<src='http://www.google.com/api/maps/foo?....'>
</script>
rest of the html page..
this effectively means that the '..maps/foo' is being served up from the
google server, but it's running on your client app.
this is also why you can have mashup functions, where your app is using the
apis of multiple systems/servers... you're using separate apis, which are
being served from separate servers.
so. now that i've clarified it a little, how about you telling me how good
you are with jscript! i have a jscript issue that i'm trying to solve!!
thanks
-bruce
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com]On
Behalf Of Jake McGraw
Sent: Friday, March 16, 2007 9:48 AM
To: jQuery Discussion.
Subject: Re: [jQuery] php - web service (ajax/jscript)
Actually, thats a damn good point, I use Google Maps on some of my websites,
and yet I gave that answer to you, perhaps they're using Iframes? Anyone
have an answer for this, now you got me interested!
- jake
On 3/16/07, bruce <bedouglas@earthlink.net> wrote:
jake...
if what you state is true. how does google/yahoo/flickr/etc... manage to
allow 3rd party websites to access their hosted apis, which are resident on
the hosted server of google/yahoo/etc....
-bruce
-----Original Message-----
From: Jake McGraw [mailto:jmcgraw1@gmail.com]
Sent: Friday, March 16, 2007 9:17 AM
To: bedouglas@earthlink.net
Subject: Re: [jQuery] php - web service (ajax/jscript)
Bruce,
I believe, regardless of the website serving the Javascript file, AJAX will
only interface with the server that actually served the entire document.
What I suggest you do is provide clients with a PHP Script / HTML Template
(Smarty is very good for this) with some AJAX Javascript.
The PHP Script can contact your web service (you can use the PEAR SOAP/WSDL
extensions or go for the full blown Tomcat/Apache config), serve whatever
information you like back to the PHP Script and then back to the browser:
Request
Web Browser/AJAX -- (XML or JSON) --> Client Server/PHP/SOAP -- (XML) -->
Your Server/(PHP or Tomcat)
Return
Your Server/(PHP or Tomcat) -- (XML) --> SOAP/PHP/Client Server -- (XML or
JSON) --> AJAX/Web Browser
So basically, your clients would need a web server that handles PHP and can
make SOAP Requests, you would author the PHP/HTML template and release that
as an "api". This is probably the best way to go about things because it
allows non-web browsers user access to your Web Service and it keeps with
the whole concept of what web services should truly be.
- jake