As I have known AJAX in the past, it has gone something like this: a server side language (in my case PHP) file generates xHTML has JS attached. The JS queries another file, with parameters set in GET
or POST
. This queried file's entire output is returned to the JS, which in turn makes a change on the original xHTML.
Now, I'm trying to do something which is sorta related to those same techniques. I want to query URLs from Excel, like
www.example.com/distance?to=FTW&from=ACR
and the entire return value would be something like
2231
If I just query the JS file directly, it won't get run.
If I set up an html page, it's trivial to have it display nothing but that number, but the return value of the query contains a bunch of tags.
How else can I do this? What if I had a PHP file, that runs the JS, then returns its value?
The business logic of getting the number has to be in javascript.