tags:

views:

121

answers:

2

I'm a little confused as to what exactly is going on here. For instance...

http://bidstick.com/latest/21249%7C21250%7C21252.js&localtime=1263468042061/

Is pulling down some JSON information, and the numbers being passed are specifying which auctions need information, but what is processing these variables. Is there some server side script that generates the JSON? It appears to be dynamic, as you can manually change the numbers and get a different response. I.E. just change any of the numbers in the link and it will provide different information. Thanks in advance.

A: 

Yes, there is a server-side script that is generating some kind of JSON-serialized output. Both ASP.NET MVC and Ruby on Rails have really simple ways of generating JSON results from what look like standard URLS.

Jarrett Meyer
It is also possible to configure web server to redirect some urls to actual scripts
vava
+1  A: 

I think what is puzzling you is: how does the response change when the parameters in the URL are changed?

If so, here's your answer:

Server side scripts are generating the output that you see. These scripts read the input URL and know what parameters to work on. (More accurately, these parameters are GET arguments). So a server script can read this, and decide what to do accordingly.

PS: now I come to think of it, you must be knowing all this, since you already know what JSON is.

EDIT:


Such scripts are not for the perusal of users of the website. This output is for use by the website itself, or for use by other websites.


To accomplish this: there are two ways I can think of:

  1. URL rewriting
  2. processing PHP inside a .js file (yes this is possible).
    You can do that by telling Apache that .js files should be processed by PHP
    I believe that can be done using the AddType directive of Apache's config file.
Here Be Wolves
Yeah, thanks. What's confusing me is the fact that it's pointing to a .js file, which is not server side. I think a poster addressed this issue by saying that you can mask url's. I guess I'm still confused as to how to accomplish this or why you would want to. Thanks for all of your posts though, I'm getting somewhere...
Booker
Turns out I misunderstood your question (completely) :) I've added edits ... hope it helps
Here Be Wolves