jQuery load(URL) not working when loading page-fragments?

Kowak

New Member
I have this page, the first button is working good.I want when press the second button to give me the link that is in the href, i tried like this , but i got the whole page , not just the value of the link , why please?\[code\]<html><head> <script src="http://stackoverflow.com/questions/15710861/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ var url = "http://localhost/test/asdfasdf.php"; $("#button").on("click", function() { $('body').load( url ); }); $("#button2").on('click',function(){ $('body').load( url +"#link" ); }); });</script></head><body> <input type="button" id="button" value="http://stackoverflow.com/questions/15710861/load" /> <input type="button" id="button2" value="http://stackoverflow.com/questions/15710861/search for a tag" /></body></html>\[/code\]
 
Back
Top