将参数传递给新选项卡的搜索框,然后显示结果 [英] pass parameters to new tab's search box and then show the results

查看:53
本文介绍了将参数传递给新选项卡的搜索框,然后显示结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家正在研究学生项目,我希望代码有一个搜索框。当我们在其中输入文本并按下搜索按钮时,它必须打开一个新选项卡,其中带有另一个搜索框的主页将是在那里,搜索文本将从上一个搜索框中复制,并且必须显示输入文本的结果。

这是搜索页面

 <   head  >  
< title > Untitled Document < / title >
< meta http-equiv = 内容类型 内容 = text / html; charset = iso-8859-1 / >
< script 类型 = text / javascript >
function submitSearch(){
alert( document .getElementById(' searchString') .value);
document .cookie = escape document .getElementById(' searchString')。value);

window .open( http:// localhost:8080 /GPS_Integration/test/test1.html);

}

< / script >

< / head >

< 正文 >
< 表格 >
< tr >
< td width = 140 > < 输入 类型 = text name = searchString id = searchString class = smallFont style = width:135px; / >
< / td >
< td width = 25 align = right > < 输入 type = 提交 名称 = searchButton id = searchButton onclick = submitSearch() / > < / td >
< / tr >
< / table >

< / body >











这是打开的下一页......但它没有显示结果..

 <   head  >  
< script < span class =code-attribute> type = javascript >
function getcookie()
{
var cookie = unescape document .cookie);
document .getElementById( pac-input )。value = cookie;
}

< / script >
< / head >
< 正文 önload = getcookie(); >

< table >
< tr >
< td width = 140 > < 输入 type = text 名称 = searchString id = searchString < span class =code-attribute> class = smallFont style = width:135px; / > < / td >
< td width = 25 align = right > < span class =code-keyword>< input type = submit name = searchButton id = searchButton / > < / td >
< / tr >
< < span class =code-leadattribute> / table >


< / body >

解决方案

传递URL上的参数。然后,告诉我们到底出了什么问题(代码没有找到参数,不能正确搜索等)


hey guys m working on a students project and i want code for " there is a search box . when we enter text in it and push the search button it must open a new tab where the main page with another search box will be there and the search text will be copied from previous search box and it must show the results of the entered text."
This is the search page

<head>
        <title>Untitled Document</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript">
            function submitSearch() {
                alert(document.getElementById('searchString').value);
                document.cookie = escape(document.getElementById('searchString').value);
                
                window.open("http://localhost:8080/GPS_Integration/test/test1.html");
                
            }

        </script>

    </head>

    <body>
        <table>
            <tr>
                <td width="140"><input type="text" name="searchString" id="searchString" class="smallFont" style="width: 135px;" /></td> 
                <td width="25" align="right"><input type="submit" name="searchButton" id="searchButton" onclick="submitSearch()" /></td>
            </tr>
        </table> 

    </body>






This is the next page which opens ...but it doesnt show the results..

<head>
<script type="javascript">
 function getcookie()
            {
                var cookie = unescape(document.cookie);
                document.getElementById("pac-input").value = cookie;
            }

</script>
</head>
<body  önload="getcookie();">

    <table>
            <tr>
                <td width="140"><input type="text" name="searchString" id="searchString" class="smallFont" style="width: 135px;" /></td> 
                <td width="25" align="right"><input type="submit" name="searchButton" id="searchButton"  /></td>
            </tr>
        </table> 


</body>

解决方案

Pass the parameters on the URL. Then, tell us exactly what goes wrong ( does the code not find the parameters, does it not search properly, etc )


这篇关于将参数传递给新选项卡的搜索框,然后显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆