I tried to do something like this :
var msg = $.get(\"my_script.php\");
I thought msg would be set to the text returned by my_script.php,i.
The return value is simply the jqXHR object used for the ajax request. To get the response data you need to register a callback.
$.get("my_script.php", function(data) { var msg = data; alert(msg); });