如何在新页面上显示AJAX响应

我正在开发phonegap中的移动应用程序并使用intel xdk,我想在我在谷歌搜索的新html页面上显示ajax响应,并找到了这个解决方案window.open(); 但这种方法对我不起作用并显示空白(白色屏幕)。 我想在search.html页面中显示数据,我正在使用jquery和ajax从数据库获取响应。

 function search() { $("#LoadingImage").show(); var valuee=document.querySelector('input[name="srch_type"]:checked').value; var srch_txt = $("#search-2").val(); if(srch_txt.length>0){ $.ajax({ url: "http://medicomall.com/andapp/?srchtxt="+srch_txt+"&srchtyp="+valuee, dataType: 'json', success: function(opt) { $("#LoadingImage").hide(); $.each(opt.waleed, function(key, value){ // alert( "SUCCESS: " + value ); if(valuee=='Medicine'){ $("ul").html ("
  • "+this['med_name']+"
  • "+"
  • "+this['med_alter']+"
  • "+this['Store_Address']+"
    "); }else if(valuee=='Doctor'){ $("ul").html("
  • "+this['name']+"
  • "+this['desc']+"
  • "); } else{ $("ul").html("
  • "+this['cl_name']+"
  • "+this['cl_address']+"
  • "); } }); }, error: function () { alert('Network error has occurred please try again!'); $("#LoadingImage").hide(); } }); } else{ alert("Please Enter Some Value"); $("#LoadingImage").hide(); } }

    创建新窗口时,请使用以下命令:

     $.ajax({ url: "http://medicomall.com/andapp/?srchtxt=" + srch_txt + "&srchtyp=" + valuee, dataType: 'json', success: function (opt) { $("#LoadingImage").hide(); //Window Settings var w = window.open(); //Append Search unordered list $(w.document.body).html(''); $.each(opt.waleed, function (key, value) { // alert( "SUCCESS: " + value ); if (value == 'Medicine') { $(w.document.body+" .search").html("
  • " + this['med_name'] + "
  • " + "
  • " + this['med_alter'] + "
  • " + this['Store_Address'] + "
    "); } else if (value == 'Doctor') { $(w.document.body+" .search").html("
  • " + this['name'] + "
  • " + this['desc'] + "
  • "); } else { $(w.document.body+" .search").html("
  • " + this['cl_name'] + "
  • " + this['cl_address'] + "
  • "); } }); }, error: function () { alert('Network error has occurred please try again!'); $("#LoadingImage").hide(); } });