Getting a variable from $.get() [solved]
Is it possible to get the value of a variable using $.get without having to echo it?
Here's the sample PHP file, and the next one is the jquery:
-
//This is the php file "loadme.php"
$i = "Hello";
$j = "world";
echo j;
jQuery here:
-
$(function(){
$.get('loadme.php', function(data){
$('body').append(data); //displays the word "world"
});
});
Is there a way to get the variable $i in the php file which contains the string "Hello" without having to echo it?