简体   繁体   English

从弹出窗口获取标题

[英]Get the title from a popup

This is a jQuery tooltip. 这是一个jQuery工具提示。

In a nutshell, the jQuery creates the popup from another HTML page. 简而言之,jQuery从另一个HTML页面创建弹出窗口。

EDIT i put up an example. 编辑我提出了一个例子。 HERE 这里

So I need to grab the title from the popup. 所以我需要从弹出窗口中获取标题。 When I use the document.title or whatever, it echos the title from the current page and not the popup. 当我使用document.title或其他名称时,它将在当前页面而不是弹出窗口中显示标题。

<div id='JT_close_right'>"+title+"</div>

I need the title in a variable: 我需要一个变量中的标题:

var title = (pop-up page's title)

simply use: 只需使用:

var title = $('#JT_close_right').html();

Since you are populating that element with the title in the function, you just need to grab that element by its id. 由于您使用函数中的标题填充该元素,因此只需要按其ID抓取该元素。 The popup you are creating is not a separate window, but just using a div as an overlay overtop of the current content, so it does not have its own document.title for example, or document object for that matter. 您创建的弹出窗口不是一个单独的窗口,而只是使用div作为当前内容的覆盖,因此它没有自己的document.title或与此相关的文档对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM