Ads displayed for guests and not donating members only. Get ad-free by donating. If you have already donated, please read here.
Results 1 to 3 of 3

Thread: get expected_tank_values_latest.json from wnefficiency.net

  1. #1

    get expected_tank_values_latest.json from wnefficiency.net

    Hello,
    At my userscript I try:
    Code:
    	var xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET", 'http://www.wnefficiency.net/exp/expected_tank_values_latest.json', true);
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
    				alert('test'); // test
    				// etc
                }
            }
        };
        xmlhttp.send(null);
    and have no result. When readyState == 4, I see status == '' and responseText==''.
    I try POST request and different setRequestHeader(), but failed again :-(
    When I upload file to dropbox, I have status == 200 and valid responseText

    How I can write correct request to http://www.wnefficiency.net/exp/expe...s_latest.json?

  2. #2
    Retired Commander Phalynx.eu's Avatar
    Join Date
    Jan 2013
    Location
    Erlangen, Germany
    Posts
    2,127
    JavaScript has a limitation regarding loading of data from another domain if a specific header flag is not set ("Access-Control-Allow-Origin").
    Feel free to download the file with any other non-JS method.
    Last edited by Phalynx.eu; 2015-10-15 at 14:13.

  3. #3
    Quote Originally Posted by Phalynx.eu View Post
    Feel free to download the file with any other non-JS method.
    I can't use "any other non-JS method" when I write userscript for browser :-)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •