开发者

Parse data from an external JSON source to display in table - Get latest data.

I am currently try to grab the data from http://www.epgpweb.com/guild/us/Caelestrasz/Crimson/

As you can see there is a dropdown menu that shows two different screenshots. I want the table to display the most recent data screenshot.

My code currently is

http://jsfiddle.net/QQSGR/

I am trying to get it to grab the most recent JSON data from http://www.epgpweb.com/api/snapshot/us/Caelestrasz/Crimson

I am at a stand still and have no idea, major rep for anyone who can solve this for me!

开发者_如何学JAVA

Currently the working version of the table can be found here - http://testing.lifestyletrader.com/DOM/index2.php

Please help!


In general javascript (ajax) cannot make an ajax call to another domain. There are two exceptions JSONP which has to be supported by the domain you're calling, or some browsers will allow a POST but still won't return any external data. Its a security thing.

If you need to make a javascript/ajax call outside of your domain then you have to create a proxy in your favorite programming language (Java/JSP, PHP, .net, asp). I've posted an answer with an example of Java code for this here:

jQuery ajax GET returns 405 Method Not Allowed

Javascript does do a great job with JSON though so I'd suggest setting up your PHP code as a simple pass-through (like the java code in my example), call it from javascript, and deal with the content in Javascript. For instance there is a JQuery pluging called datatables you could use to build the table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜