我正在尝试使用window.location.href从当前的主页重定向到使用查询字符串的另一个页面,但它重定向到当前即主页 再次页面。 虽然代码看起来不错,但我不知道丢失了什么。
当前网址:http://win-aslbkn4mm3v:10001/sitepages/Content%20Page/rch_home.aspx
期待网址:http://win-aslbkn4mm3v:10001/sitepages/Content%20Page/Doctors.aspx?qn=ddd&qs=ddd&qd=ddd
但获取网址://win-aslbkn4mm3v:10001 / sitespages/Content%20Page/rch_home.aspx
function SearchDoctor()
{
debugger;
var Name = document.getElementById("SearchName").value;
var Speciality = document.getElementById("SearchSpeciality");
var spl = Speciality.options[Speciality.selectedIndex].text;
var Department = document.getElementById("SearchDepartment");
var dept = Department.options[Department.selectedIndex].text;
var mainUrl= '../../../Doctors.aspx?qn=' + Name + '&qs=' + Speciality + '&qd=' + Department;
window.location=mainurl;
}