If you don’t send any valid data in the Ajax function it won’t work.
If the page you are sending it to does not work by it’s self don’t expect the response to either.
Don’t use .submit and try to get a value back – it won’t!
Test what you are sending!!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <input type="button" class="myclass" name="mybutton" id="mybutton" value="mybutton"> <script> $(document).ready(function(){ $("#mybutton").click(function() { $.ajax({ url: "response.php", dataType: "html", type: 'POST', // data: "panelid="+idno, //variable with data success: function(data){ $(".test").html(data); alert(data); } }); //end ajax }); //end function }); //end doc </script> <h5>response.php</h5> Echo "Hello"; |