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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -