The following simple html page is not responding to as it should when click on either "click" or "hide all paragraphs" button.I have included jquery lib "jquery-1.9.1.min.js" and I can see its all content in Firefox's 'view source page' by click it.This file's url in my browser is:mylocalhost:8080/ajaxAppJquery/tryAjax.jsp.Using Netbeans IDE.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Simple Ajax Example</title>
<script src="jquery-1.9.1.min.js"></script>
<script>
$("#button").click(function(){
alert("working");
var url="http://localhost:8080/ajaxAppJquery/sayHello.jsp";
$("#result").load(url);
});
$("#hide").click(function(){
$("p").hide();
})
</script>
</head>
<body>
<input id="button" value="click" type="button"/>
<input id="hide" value="hide all paragraphs" type="button"/>
<p>paragraph 1</p>
<p>paragraph 2</p>
<p>paragraph 3</p>
<p>paragraph 4</p>
<p>paragraph 5</p>
<p>paragraph 6</p>
<div id="result"></div>
</body>
</html>
When i click on #button it does not alert the message.Actually I am experimenting with jquery-ajax but it is not working with #hide button also.