[英]Need page 1 Javascript to action a DIV that i have inserted on my page 2?
I am currently working on the standard 'Yahoo Hosted Web Search' scripting but having a few issues. 我目前正在使用标准的“ Yahoo托管的Web搜索”脚本,但是有一些问题。
On the search box on my homepage (index.html) you enter a query then hit submit for a yahoo search to return results on the same page. 在我主页(index.html)上的搜索框中,输入查询,然后点击“提交”以进行yahoo搜索,以在同一页面上返回结果。
This submit action triggers the yahoo javascript on the homepage to return search results on the same page via the placing of an appropriate div within which a results iframe loads. 该提交操作触发了首页上的yahoo javascript,以通过放置适当的div来在同一页面上返回搜索结果,在该div中加载结果iframe。
THE FULL PROCESS SCRIPTING IS AS FOLLOWS: 完整的过程脚本如下:
============================================================= ================================================== ===========
< form id="searchform" onsubmit="return search();"> <form id =“ searchform” onsubmit =“ return search();”>
<input type="text" id="searchbox" size="10" />
<input type="submit" value="Submit"/>
</form >
: :
===================================================================== ================================================== ===================
<script type="text/javascript">
function search() {
YHS.search(document.getElementById("searchbox").value);
</script>
===================================================================== ================================================== ===================
EXTRACT COMMAND::::::::::::::::::: 提取命令:::::::::::::::::::
dom_id: "bossDiv", // id of div tag under which BOSS Hosted Search iframe will be rendered dom_id:“ bossDiv”,//将在其下呈现BOSS Hosted Search iframe的div标签的ID
===================================================================== ================================================== ===================
<div id="bossDiv">
</div>
This is the empty div tag within which the BOSS Hosted Search experience will be shown. 这是一个空的div标签,将在其中显示BOSS Hosted Search体验。 You will need to replace the with this div id ('bossDiv') in the Javascript code snippet 您需要在Javascript代码片段中用此div ID('bossDiv')替换
=============== ===============
Now basically i would like to ensure that my results are presented on a 2nd page not the homepage. 现在基本上我想确保我的结果显示在第二页而不是首页上。 The issue is the DIV TAG: ID 'bossDiv' loads the iframe on the homepage.. is there anyway i can insert this DIV into say results.html and have the homepage somehow command the div on the results.html page to display the search results there instead? 问题是DIV标记:ID'bossDiv'将iframe加载到首页上。无论如何,我可以将此DIV插入到results.html中,并让首页以某种方式命令result.html页上的div显示搜索结果结果在那里呢?
Been trying so hard to try form actions etc but the only way i can see that this will work is if i simply insert the div into the results.html page and somehow tell the yahoo javascript on index.html where to find the DIV or redirect the page to find and trigger the DIV ?? 一直在努力尝试表单操作等,但是我能看到的唯一方法是,如果我只是将div插入results.html页面,然后以某种方式告诉yahoo javascript在index.html上找到DIV或重定向的地方查找并触发DIV的页面? Does anyone know of a way to tell a java where to find a div on another page to trigger and action it there upon a query search submit..? 有谁知道一种告诉Java在另一个页面上的div位置在哪里触发并在查询搜索提交时在其中进行操作的方法吗?
Please help its been wrecking my brain for at least 2 weeks now and i dont know what steps to take anymore from reading alot of jumble online :( 请帮助它破坏我的大脑至少2周,而我不知道从网上阅读大量的杂物后该采取什么步骤了:(
Thank all! 谢谢大家!
You can't access another page via javascript - a common approach for searching is to use a QueryString 您无法通过javascript访问另一个页面-一种常见的搜索方法是使用QueryString
How can I get query string values in JavaScript? 如何获取JavaScript中的查询字符串值?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.