我有十个html页面,每个页面都有相同的搜索选项卡,当我从任何页面点击搜索按钮时,它会导航到索引页面,搜索文本通过查询字符串传递并在索引页面上显示输出。如何在索引页面上单击索引页面,并在索引页面搜索选项卡中输入搜索参数,并在索引页面上显示结果。 我使用了以下逻辑: example1.html的 ......
$("#SearchButton").click(function() {
var address = ($("#s1").val());
var keyword2 = ($("#s2").val());
var radius2 = ($("#s3").val());
$.cookie("spaddress", address);
$.cookie("spkeyword", keyword2);
$.cookie("spradius", radius2);
window.location.href = "http://localhost:4745/blsk22-9-2010/seek.html?page1=1";
});
...... .. 的index.html .....
$(document).ready(function() {
var page1 = Request.QueryString("page1");
alert(page1);
if (page1 == 1) {
map = new GMap2(document.getElementById('SearchMap'));
var keyword1 = $.cookie('spkeyword');
var radius = $.cookie('spradius');
var address1 = $.cookie('spaddress');
....
....
}
else
{
$("#SearchButton").click(function() {
var keyword1 = ($("#text1").val());
var radius = ($("#radiusSelect").val());
var address1 = ($("#addressLocation").val());
....
.....
.....
}