This code is Working Perfectly with the help of JQuery and YQL
$(document).ready(function(){
var container = $( #target );
$( .ajaxtrigger ).click(function(){
doAjax($(this).attr( href ));
return false;
});
function doAjax(url){
if(url.match( ^http )){
$.getJSON("http://query.yahooapis.com/v1/public/yql?"+
"q=select%20*%20from%20html%20where%20url%3D%22"+
encodeURIComponent("http://www.yahoo.com")+
"%22&format=xml &callback=?",
function(data){
if(data.results[0]){
var data = filterData(data.results[0]);
container.html(data);
} else {
var errormsg = <p>Error: could not load the page.</p> ;
container.html(errormsg);
}
}
);
} else {
$( #target ).load(url);
}
}
function filterData(data){
data = data.replace(/<?/body[^>]*>/g, );
data = data.replace(/[
|
]+/g, );
data = data.replace(/<--[Ss]*?-->/g, );
data = data.replace(/<noscript[^>]*>[Ss]*?</noscript>/g, );
data = data.replace(/<script[^>]*>[Ss]*?</script>/g, );
data = data.replace(/<script.*/>/, );
return data;
}
});