Windows 7 小工具弹出窗口问题
我创建了一个小工具,用于显示来自网站的提要并将其显示在主窗口中。 如果我点击其中一条新闻,我会看到弹出窗口,它会为我提供更多信息。 我在主体中还有一个搜索选项,可以在网站上进行搜索,但会在浏览器窗口中打开。
我的问题是如何在弹出窗口中打开搜索功能? 有没有办法将搜索按钮链接到 Flyout_2 文件? 也许有人可以指出我正确的方向。
I created a gadget that displays the feed from a website and displays it in the main window.
If I click on one of the news I get the flyout window and it gives me more information.
I also have a search option in the main body, that does the search on the site but it opens in the browser window.
My question is how can I make the search function open in the flyout window?
Is there a way to link the search button to a flyout_2 file?
Maybe someone can point me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须手动打开弹出窗口。
整个界面很糟糕。浮出控件还必须指向有效的 HTML 页面(本地或远程,这并不重要)。 但是,一旦加载,您就可以按照自己喜欢的方式处理 DOM。
也就是说,捕获“搜索”事件并将其显示到弹出 DOM。这可以通过弹出窗口本身的重定向、具有动态设置目标的 iframe 或其他 DOM 操作来实现。
我使用的一个技巧是使用“通用”弹出窗口,它只是调用父窗口上的一个方法,将其本身作为参数传递(弹出窗口只是子窗口),然后让“主”小工具实际处理基于 DOM 的工作根据上下文。
请注意:在我的例子中,我运行了一个稍微修改过的 jQuery,其中文档绑定在一个闭包中。这允许我引用“文档的正确 jQuery 对象”,上面是通过 _j 访问的。
Flyout windows must be opened manually.
The entire interface is soup. A flyout must also be pointed to a valid HTML page (locally or remotely, it doesn't matter). Once loaded, however, you can treat the DOM however you like.
That being said, capture the "search" event and make it display to the flyout DOM. This could be with a redirect of the flyout itself, an iframe with a dynamically set target, or other DOM manipulation.
One trick I have used is to use a "generic" flyout which simply invokes a method on the parent window passing in itself as a parameter (flyouts are are just child windows) and then let the "main" gadget actually handle the DOM work based on context.
Please note: in my case I run a slightly modified jQuery in which document is bound in a closure. This allows me to refer to the "correct jQuery object for the document", above that is accessed via _j.