JavaScript XMLHttpRequest response access denied despite same-origin xmlhttprequest access response

response is JSON


Edge: sometimes inserts response property value into DOM briefly then removes it, sometimes logs error "SCRIPT5: access denied" (indicating CORS), response fully accessible from Debugger, request shown in network tab

Chrome: response empty string, request not shown in network tab, no console message

Firefox: console error 'response "malformed JSON"' on breakpoint line using response in JSON.parse(), thus before usage, request not shown in network tab, Firebug and integrated


JS (current browsers only):

var session = "";
var request;
function checkLogin()
{
    if(request.readyState > 3)
    {
        var response = JSON.parse(request.response);
        if(verify(response))  // verify inserts argument property "error" in DOM on error via innerHTML on element
        {
            // do something
        }
    }
}
function login()
{
    request = new XMLHttpRequest();
    request.onreadystatechange = checkLogin;
    request.open("GET", "authenticateUser.php?user=" + document.getElementById("user").value + "&credential="+md5(document.getElementById("password").value));
    request.send();
}

Edge request from network tab:

Anforderungs-URL: http://*MYDOMAIN*/authenticateUser.php?user=df&credential=d41d8cd98f00b204e9800998ecf8427e
Anforderungsmethode: GET
Statuscode: 200 / OK
 - Anforderungsheader
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: de-DE, de; q=0.8, en-US; q=0.5, en; q=0.3
Connection: Keep-Alive
Host: *MYDOMAIN*
Referer: http://*MYDOMAIN*/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
 - Antwortheader
Connection: Keep-Alive
Content-Length: 65
Content-Type: application/json
Date: Sat, 21 Nov 2015 07:42:17 GMT
Keep-Alive: timeout=15, max=94
Server: Apache
X-Powered-By: PHP/5.5.29

response:

{"success":false,"error":"authentication failed or unauthorised"}

What is going to make my phps' response be usable in JS code (in Chrome and Firefox) and its properties value be insertable into the DOM?

Answer:1

I am making a digital clock. I made a button and this button changes clock's format(between AM/PM System and 24 hours system). But the problem is when i switch Intervals, both intervals working at the ...

I am making a digital clock. I made a button and this button changes clock's format(between AM/PM System and 24 hours system). But the problem is when i switch Intervals, both intervals working at the ...

Was trying to do an restful update. my model.js module.exports.updateGenre = function (id, genre, callback) { var query = {_id: id}; var update = { name: genre.name } Genre....

Was trying to do an restful update. my model.js module.exports.updateGenre = function (id, genre, callback) { var query = {_id: id}; var update = { name: genre.name } Genre....

I have try to stop refresh page on click on select option but when I stop refresh page then data can not get. here code echo "<form name='frmtopdevotees' method='post' action='topuser_load.php'&...

I have try to stop refresh page on click on select option but when I stop refresh page then data can not get. here code echo "<form name='frmtopdevotees' method='post' action='topuser_load.php'&...

  1. retrieving data with php
  2. retrieving data with url
  3. retrieving data with transact-sql
  4. retrieving data with cursors
  5. retrieving data with dbcontext
  6. retrieving data from firebase
  7. retrieving data from hard drive
  8. retrieving data from broken phone
  9. retrieving data from broken iphone
  10. retrieving data from firebase android
  11. retrieving data from database
  12. retrieving data from icloud
  13. retrieving data from mysql using php
  14. retrieving data from external hard drive
  15. retrieving data from dead phone
  16. retrieving data from dead iphone
  17. retrieving data from old hard drive
  18. retrieving data from firebase kotlin
  19. retrieving data in sql
  20. retrieving data from database using php

This regex matches "so" when it's preceded by a comma and a space: (,\s)(so) I want to do the opposite now. I want to tell the regex: don't match "so" if it's preceded by a comma and a space. I ...

This regex matches "so" when it's preceded by a comma and a space: (,\s)(so) I want to do the opposite now. I want to tell the regex: don't match "so" if it's preceded by a comma and a space. I ...

  1. donald trump
  2. donovan mitchell
  3. donald trump twitter
  4. don toliver
  5. donuts
  6. donald trump age
  7. donatos
  8. donald glover
  9. donald trump net worth
  10. donuts near me
  11. donald trump jr
  12. donepezil
  13. don johnson
  14. donald trump speech today
  15. donna shalala
  16. donna summer
  17. donald cerrone
  18. don julio
  19. donnie darko
  20. don quixote