Skip to content

Tag: ajax

URL of open(…) relative or absolute

I don’t quite understand the functioning of the url parameter of XMLHttpRequest open(method, url, async). Let’s say I have a web server like that: page.html sends an asynchronous request to controller.php. As we can only send requests to our own web server, I assume that we don’t have to rew…

AJAX works on localhost, but doesn’t on live server

Below code works on localhost, but not on live server. MAIN EDIT: Only 1 thing remains which is not working: On AJAX success this will being executed: How ever, the label(for example) is not being updated. The label needs to be updated by the score which is given (data.score_result). Ajax code: When I put ale…

XMLHttpRequest.onload constructor in Javascript?

When making a new XMLHttpRequest, like so There is a method (property ?) called onload. My question is, why we can assign a function to it? like this If onload is a property in XMLHttpRequest, the value of it will change when we assign a new value to it, like a function, right? What is the XMLHttpRequest.onlo…