Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用ajax放置HTML选项卡_Javascript_Php_Jquery_Html_Ajax - Fatal编程技术网

Javascript 使用ajax放置HTML选项卡

Javascript 使用ajax放置HTML选项卡,javascript,php,jquery,html,ajax,Javascript,Php,Jquery,Html,Ajax,我想将使用JQueryUI创建的选项卡放在我现有的HTML页面中。我创建了一个用于显示使用Ajax接收的HTML内容的窗口。但选项卡显示不正确。下面是我的ajax函数 function GetVendorProfile(Category,Business) { var xmlhttp; if ((Category== 0) || (Business == 0)) { document.getElementById("ShowVendorProfile").innerHTML="Pl

我想将使用JQueryUI创建的选项卡放在我现有的HTML页面中。我创建了一个用于显示使用Ajax接收的HTML内容的窗口。但选项卡显示不正确。下面是我的ajax函数

function GetVendorProfile(Category,Business) {
var xmlhttp;    
if ((Category== 0) || (Business == 0))  {
  document.getElementById("ShowVendorProfile").innerHTML="Please select Category";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {     document.getElementById("ShowVendorProfile").innerHTML=
                   xmlhttp.responseText;
    }
  }
if ((Category == "Function Hall") && (Business != 0)){
    xmlhttp.open("GET","vendorprofile.php?Business="+Business,true);
}
xmlhttp.send();
} 
My vendorprofile.php包含简单的选项卡。请告诉我是否有其他方法可以使用ajax成功显示HTML。

试试看

您可以轻松地从服务器直接加载到html:

$("#ShowVendorProfile").load("vendorprofile.php?Business="+Business);