I don't see you including jQuery anywhere in that document, which you need to do in order to use the object's properties and methods.
To include your jquery script in your document, you simply add it as a script line to your head tag:
<script type="text/javascript" src="yourscriptpathgoeshere.js"></script>
Take note that it must go before any of the scripts that use jquery.. it cannot go after the script, for instance.
The below code, as an example, works fine for me:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var url = "http://localhost/testing/test.php";
$("#button").on("click", function() {
$('body').load( url );
});
});
</script>
</head>
<body>
<input type="button" id="button" value="click" />
</body>
</html>
To get the href of a specific link.. provided the html is valid(and only one item has the id 'link'), use the following method: .attr()
, in the following manner:
var href = $("#link").attr('href');