javascript - Ajax Data response data not alert -
I want to alert some data using AJAX callback, but not alerts.
& lt; Script type = 'text / javascript' src = '// ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js?ver=4.0'></script> & Lt; Script & gt; Var mainObject = {myFunction: function () {$ .ajax ('ajax.php', function (data) {warning (data); // $ ('# test123'). Html (data);}); }}; & Lt; / Script & gt; & Lt; Div id = "test123" & gt; & Lt; / Div & gt; & Lt; A href = "javascript: mainObject.myfunction ();" & Gt; Click here & lt; / A & gt;
ajax.php
& lt; Php echo "Hello World !!!"; ? & Gt;
I get the answer Hello World !!!
But there is no alert. Please check the code above
$ Post
instead of instead of $ .ajax
code:
var mainObject = {myFunction: function () { $ .post ('ajax.php', function (data) {warning (data); // $ ('# test123'). Html (data);}); }};
Comments
Post a Comment