Scusa il ritardo ma stavo facendo un'altra cosa e mi sono ricordato solo ora di guardare.
Sostituisci la parte che mi hai citato con:
Codice:
//web:
var results = response.SearchResponse.Web.Results;
for (var ii = 0; ii < results.length; ii++)
{
var titlee=results[ii].Title;
if (!titlee) titlee='';
var diss=results[ii].Description;
if (!diss) diss='';
var urll=results[ii].Url;
if (!urll) urll='';
var display_urll=results[ii].DisplayUrl;
if (!display_urll) display_urll='';
var array_deep_links=results[ii].DeepLinks;
if (!array_deep_links) array_deep_links="";
var array_search_tags=results[ii].SearchTags;
if (!array_search_tags) array_search_tags="";
var cache_url=results[ii].CacheUrl;
if (!cache_url) cache_url="";
//WebResult.DeepLinks Property (Bing, Version 2.2)
//WebResult.SearchTags Property (Bing, Version 2.0)
//WebResult.CacheUrl Property (Bing, Version 2.1)
var final_deep_cascata='<table><tr>';
var final_deep=final_deep_dominio='';
for(k = 0; k < array_deep_links.length; k++){
if (array_deep_links.length>=8){
//final_deep+='<a href="'+array_deep_links[k].Url+'" target="_blank">'+array_deep_links[k].Title+'</a> ';
}else if (array_deep_links.length<4)
final_deep_dominio+='<a href="'+array_deep_links[k].Url+'" target="_blank">'+array_deep_links[k].Title+'</a> ';
else {
//if (k==4) final_deep_cascata+='</tr><tr>';
//final_deep_cascata+='<td style="font-size:14px;padding:10px;"><a href="'+array_deep_links[k].Url+'" target="_blank">'+array_deep_links[k].Title+'</a></td>';
}
}
final_deep_cascata+='</tr></table>';
var final_tags='';
for(k = 0; k < array_search_tags.length; k++){
if (array_search_tags[k].Value.search('http://')==1)
final_tags+='<div style="font-size:9px;">'+array_search_tags[k].Name+' : <a href='+array_search_tags[k].Value+' target="_blank">'+array_search_tags[k].Value+'</a></div>';
else
final_tags+='<div style="font-size:9px;">'+array_search_tags[k].Name+' : '+array_search_tags[k].Value+'</div>';
}
var final_cache_url='<a href="'+cache_url+'" target="_blank">Pagina nella cache</a>';
var title=DisplayTextWithHighlighting(titlee);
var dis=DisplayTextWithHighlighting(diss);
var display_url=DisplayTextWithHighlighting(display_urll);
var final="<div class='webresult'><div class='title'><a href='"+urll+"' target='_blank'>"+title+"</a></div><div class='desc'>"+final_deep+"</div><div class='desc'>"+dis+"</div><div class='url'>"+display_url+" "+final_deep_dominio+" "+final_cache_url+"</div><div class='desc'>"+final_deep_cascata+"</div><div class='url'>"+final_tags+"</div><input type='button' class='buttonsForIframe' value='Anteprima Sito' /></div>";
switch (ii) {
case 0:
$("#result1").html(final);
break;
case 1:
$("#result2").html(final);
break;
case 2:
$("#result3").html(final);
break;
case 3:
$("#result4").html(final);
break;
case 4:
$("#result5").html(final);
break;
case 5:
$("#result6").html(final);
break;
case 6:
$("#result7").html(final);
break;
case 7:
$("#result8").html(final);
break;
case 8:
$("#result9").html(final);
break;
case 9:
$("#result10").html(final);
break;
case "":
break;
//default:
}
}//end for
}//end if(response.SearchResponse.Web.Results.length)
else
{
$("#result").html("<div id='no'>No results</div>");
}
$('.buttonsForIframe').mouseover(function(){
var url = $(this).siblings(".url").html();
$('#anteprimaSito').attr("src", url);
$('#anteprimaSito').show();
});
$('.buttonsForIframe').mouseout(function(){
$('anteprimaSito').hide();
});
}//end function (response)
});//end $.ajax({
//end Web
$('#result_tot').removeClass('loading');
}//end function search(offset){
$(document).ready(function(){
/*
$('body').bind('click',function (evt) {
//alert('Nodo ' + evt.target.nodeName);
alert($(evt.target).text());
});
*/
$(".search_input").focus();
});
</script>
Di sicuro poi bisognerà sistemare un po' di cose tramite css.
Fammi sapere se funziona.
EDIT:
Ovviamente devi aver creato da qualche parte l'iframe:
Codice HTML:
<iframe src="" id="anteprimaSito"></iframe>