简体   繁体   English

需要第1页的Javascript来操作我在第2页上插入的DIV吗?

[英]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.

相关问题 我需要<a>在我的网页中</a>点击我的<a>标签</a>来调用一个 Javascript 函数<a>来显示和隐藏</a><div><a>内容</a> - I need to call a Javascript function on click of my <a> tag in my web page to show and hide <div> content 我需要使div的动画从右边到中间的页面离开 - I need to animate my div from off page on the right to the middle 我已经在我的数据库中插入了信息,我也验证了它。 但如果我点击插入它重定向到另一页 - i have inserted the information in my database and also i have validate it. but if i click to insert it is redirecting to another page 我需要使用简单的javascript来阻止页面刷新 - I need to stop my page from refreshing with simple javascript 我有一个使用ajax调用在另一个页面的div标签中加载的html页面,我想在加载的页面上触发javascript函数吗? - I have a html page that loaded in div tag in another page using ajax call I want to trigger javascript functions on loaded page? 我需要使用 JavaScript 或 Z4C4AD5FCA2E7A18AA44DBB1CED0Z03 链接到我当前 HTML 页面中的另一个 HTML 页面 - I need to link to another HTML page inside my current HTML page using JavaScript or HTML 我需要一种表单,如果选中了表单中的复选框,然后将“提交”按钮打印页面,该表单会将一个类应用于div - I need a form that will apply a class to a div if a checkbox in form is checked then have submit button print the page 如何将JavaScript结果绑定到我页面上的div? - How to bind JavaScript result to a div on my page? 我有一段需要在新页面中打开的html / javascript,但是我正在使用Wix.com - I have a piece of html/javascript that need to be opened in a new page, but I'm using Wix.com 我已将用户名和密码存储在本地存储中的密钥登录中,我需要使用 JavaScript 代码从主页验证我的代码是否正确? - I have stored username and password to a key login in local storage and I need to validate from home page using JavaScript code Is my code is correct?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM