I want to get data from an external php file. This is how I would normally do it but this time I am not sending any data in the request. How do I achieve this when no data is being sent in the request?
Code:
<script type="text/javascript" src="text-utils.js"> </script>
<script type="text/javascript" src="request.js"> </script>
<script type = "text/javascript">
window.onload = function() {
getProjects();
}
function getProjects() {
var url = "needmodule.php";
url = url + "&dummy=" + new Date().getTime();
request.open("GET", url, true);
request.onreadystatechange = updateProjects;
request.send(null);
}
function updateProjects() {
if (request.readyState == 4) {
var returned = request.responseText;
alert(returned);
}
</script>
Comment