Trying To Load Data From Other Server

Hey,

You know how Google Analytics or Google Adsense lets you copy and paste javascript to your site and you can load data/track visitors/etc. Well, I want to do the same thing for my customers, on their domains, where they load dynamic prices on my server (long story).

Is $getJSON the best solution in this day and age? I would prefer to not force them to use frames and I am not worried (nor are they, for reasons I wont’ get into) about users who don’t use javascript.

In short, our site processes payments for them and there is a unique feature that offers dynamic prices. So if they have javascript code with an order button image, I want them to hit my server and have their javascript code read my server, find the updated price, and display it to their user.

Besides getJSON, what other solutions would you use? Would image src with a php page be appropriate?

Please note they will be using .html pages, not php, and they are not programmers and I want to simplify it. I am just wondering if my idea of getJSON is the most efficient/logical solution.

Thanks

Seems sensible to me. Make sure you follow the docs to ensure the code will run across domains. An image would be less desirable as it won’t look as good and users can’t select the text.

Thank you for the reply. If I may, I just had one last question.

The price is dynamic and we were thinking of using a personalization token, such as {price} so we can update it each time a user requests the JSON feed. For instance, at 5PM it might be $9.97 but in an hour $10.37…

So I was wondering if it makes sense to handle the token personalization on the MAIN server instead of having users copy/paste jscript code with tokens/etc. The other question is if the user should only be copying pasting code that offers:

A.) getJSON function to retrieve current price from main server

B.) A ‘silent refresh’ that hits the server every 10-20 seconds for the updated price.

Logically, does my plan make the most sense in terms of being efficient and getting the job done?

Thanks. I will do the work and research, I just wanted to see if I was overlooking any logic 'pitfalls.

Ignore. I am thinking too much. Was an idea a client had but I realize it’s just important to hit the server with the proper querystring (user_id&product_id) and get the value via JSON each time the page loads or each time a ‘silent refresh’ hits

Ty for your time.