我的网站是:http://server1.bioprotege-inc.net/permanent_Files/digichat_admin_panel/#Home
显示“home”的链接会降低我指定的内容,但我无法上班的内容是使用下拉菜单中的一个选项删除与主页链接相同的内容但是我不能让它像那样和建议吗?
// JavaScript Document
$(document).ready(function(){
$("#Home").click(function(){
Load_ajax_page("Content_Files/Home.html");
});
$("#Chat").click(function(){
Load_ajax_page("Content_Files/Chat.html");
});
$("#Rules_List").click(function(){
Load_ajax_page("Content_Files/Rules_List.html");
});
$("#The_Team").click(function(){
Load_ajax_page("Content_Files/The_Team.html");
});
$("#Forums").click(function(){
Load_ajax_page("Content_Files/Forums.html");
});
});
function Load_ajax_page(url){
//this is a jquery method to make a ajax request
$.post(url,"",function (data){
//this is the place where the data is returned by the request
//remove loading and add the data
$("#response").html(data);
});
}
HTML CODE NOW FOR DROPDOWN MENU:
<form onclick="">
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')" style="width:582px; height:25px;">
<option value="#">Enter Free Hosted Sites:</option>
<option value="#"></option>
<option value="#Home">Hosted1 - Shadow Hunters</option>
<option value="http://www.google.com">Hosted2</option>
<option>Hosted3</option>
<option>Hosted4</option>
</select>
</form>
<br />
<div id="response"></div>
答案 0 :(得分:0)
您可以使用此代码:
<script type="text/javascript">
try{
xmlhttp = new XMLHttpRequest();
}
catch(ee){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E){
xmlhttp = false;
}
}
}
div_base = "";
valor = 0;
function abre(arquivo,metodo,div){
div_base = div;
valor++;
xmlhttp.open(metodo,arquivo+"?valor="+valor);
xmlhttp.onreadystatechange=response
xmlhttp.send(null)
}
function response() {
nova_div = div_base;
document.getElementById(nova_div).innerHTML="<div style='top:50%;left:50%;position:absolute;'>Loading...</div>"
if (xmlhttp.readyState==4){
document.getElementById(nova_div).innerHTML=xmlhttp.responseText
}
}
</script>
<form>
<select name="menu">
<option onclick="javascript: abre('Content_Files/Home.html','GET','response');">Home</option>
<option onclick="javascript: abre('Content_Files/Chat.html','GET','response');">Chat</option>
<option onclick="javascript: abre('Content_Files/Rules_List.html','GET','response');">Rules_List</option>
<option onclick="javascript: abre('Content_Files/The_Team.html','GET','response');">The_Team</option>
<option onclick="javascript: abre('Content_Files/Forums.html','GET','response');">Forums</option>
</select>
</form>
<br /><br />
<div id="response"></div>