Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
- </head>
- <body>
- <button type="button" onclick="get_incursion_data();">Get data</button>
- <div id="output">
- </div>
- <script>
- function get_incursion_data() {
- $.ajax({
- url: "crest_proxy.php",
- data: {request_url: "http://public-crest.eveonline.com/incursions/"},
- dataType: 'json',
- success: function(response) {
- response_string = JSON.stringify(response);
- document.getElementById("output").innerHTML = response_string;
- // part below overrides the line above and shows example how to move through json response from CREST
- var total_number = response.totalCount_str;
- var data_From_server = "";
- for (var i=0;i<total_number;i++) {
- name = response.items[i].constellation.name;
- state = response.items[i].state;
- data_From_server = data_From_server + "name: " + name + " state: " + state + "<br>";
- }
- document.getElementById("output").innerHTML = data_From_server;
- }
- });
- }
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment