English 中文(简体)
Javascript Popup Window as a oneton
原标题:Javascript Popup Window as a singleton
  • 时间:2011-09-08 02:06:06
  •  标签:
  • javascript

我有一页A,打开了我Win = 窗户的 j窗。 现在在同一领域的另一页B中,当用户点击链路时,我想检查一下我的Win是否可用,如果是的话,把这个窗子放在前面,否则会做新的我的手。

我的问题是网页和窗户的窗户。 j 包括一行

var myWin = 无;

目 录 范围、我的逻辑工作,把窗户放在前面。 另见B页。 当我打开A页的窗户时,如何在B页的链接上点击,那就失败了。

在B页的范围内,我Win被重新定为无效。 我如何解决这一问题? 点子?

问题回答

人口窗口由A页创建,只有A页提到这一窗口。 当你打开B页时,没有办法将A页的提及放在B页上。 不能做到这一点。

你们要打窗。 开放,如空洞。

var newWindow = window.open(  , title, dimension); // title needs to be a constant
if (newWindow.location.href && newWindow.location.href!= about:blank ) {
  // Window was already open and points to something
  newWindow.focus();
} else {
  // new window make it point to something
  newWindow.location.href =  http://yoursite ;
}

由此推断,登峰正打开与拨号相同的网站的窗口,因为否则你会遇到各种许可问题。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签