Well I'm making a system, and I need to get the variable of a php page every time, so I can work on it on my index.php page.
A friend of mine who understands more about ajax than I passed the following code:
However, I do not know how to pass the values of the variable x in PHP ( loading.php ), to my JavaScript in the page index.php
.
The code of my index.php page looks like this:
<html>
<head>
<script src="jquery-3.0.0.min.js"></script>
</head>
<body>
<script type="text/javascript">
$.get("loading.php", function(data) {
alert(data);
});
</script>
</body>
</html>
How can I do this?