Window Refuses To Close In OSX/Safari 3.1?

Feb 4, 2009

got an one that might prove interesting. I have a window that refuses to close in OSX/Safari 3.1 if it has any history.

Details:

I have an embedded flash app that offers links. These links will initiate a new window. I have little access to the working of the links, so I am assuming that they are using window.open and call the popup page.

So once the window is open, I have a link within that window to close it using an a tag that fires a js function which in turn uses self.close(); See code below. This works well in all cases. The problem comes into play under the following conditions:

1) Mac/Safari 3.1 (note that XP/Safari 3.1 does NOT produce the same issue)

2) Once the window is open, the user clicks a 2nd link from the Flash app, showing the selected html page and adding history to the popup window.

3) The user then tries to close the window, which now fails.

4) Any additional addition to the popups history yields the same results (as one might imagine).

I tried to use javascript to navigate back to the initial history point, and then run self.close. This sort of worked as I would revert back in the history stack with the first click, then the window would close on the second call to the close function. But I couldn't get it to work in one click. I did notice that adding an alert between the history rollback and the self.close() actually allowed this idea to work. So I tried a setTimeout, but did not have success. Seems like there's something there, but I guess I don't understand well enough to come up with the solution.

Code:
function self_close(){
self.close();
}

HTML Code:
<a href="#" onclick='javascript:self_close();return false;'>close</a>

View 2 Replies


ADVERTISEMENT

User Can Close The Browser Or To Open The Window Browser Without Or With A Disable Close Window Button?

Apr 5, 2009

I need to know if the user close the browser or to open the window � browser without or with a disable close window button How can I???

View 6 Replies View Related

Use Top.close For Safari?

Jun 21, 2011

Is anyone knows how to use top.close in javascript in safari browser?

View 3 Replies View Related

Trap The Window.close() Event When The User Clicks On The Close Button Of The Browser

Jul 20, 2005

I want to trap the window.close() event when the user clicks on the close button of the browser using javascript. Can anyone shed light on this problem ?

View 1 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

"window.close()" Won't Close My Popup Window In Most Browsers

Apr 7, 2010

- I have a button on my Flash site that opens an HTML page in a popup window. In Flash, I open the new window using Actiosnscript 2.0:

- Within the popup window are links to other HTML pages. They all open in the same window. I've been using the following to create the links in Dreamweaver:

- On each page, I have a "Return to Main Menu" button that should close the popup window. To do this, I have been using:

- The problem is that it works differently in each browser, and I can't even get it to consistently close the window in most browsers:

Internet Explorer = popup message appears, asking "Are you sure you want to close this window?" or something similar; window closes after clicking "Yes."

Safari = Only closes if I'm on the original HTML page. If I click on any of the other links (note that these all open in the same window), those pages' "Return to Main Menu" buttons cease to work. However, if I keep clicking "Back" until I get to the original page, it closes.

Opera = Button actually works for each page.

Firefox & Chrome = Does not close the window at all.

I looked into it and saw that others have used a window.opener to solve similar issues. But, since my popup window is opened using Flash/AS2, I need to find a way around it.

I've tried preceding "window.close()" with "window.opener=null" (i.e. -onClick="window.opener=null; window.close()"), but I don't think I'm doing it right because it still doesn't work.

I've also seen others use codes that involve functions and variables, but it is beyond my current coding knowledge to implement this. Like I said, I'm sort of new at this.

View 5 Replies View Related

Script To Close Old Window And Open New Window With New Link And Specific Size

Jan 29, 2006

I need a script that will open a new window (popup / new link) in a specific size, but will also close the old window (where the popup came from). I know the popup window is easy but finding a work-able close window script as the new window is opened is impossible!!

View 3 Replies View Related

Capture Child Window Close Event In Parent Window?

Feb 1, 2010

I have an HTML page where I am opening a child window using window.open. the child window is something like yahoo.com. I want to refresh the parent window when the child window is closed.

View 1 Replies View Related

Close Child Window When Parent Window Closes?

May 3, 2009

I'm trying to create code to close the child window I'm creating if the parent window is closed. Here's my code so far:

function openWindow() {
var newWin = window.open(); // open the new window
newWin.document.write('<h1>Child Window</h1>

[Code]...

The above openWindow function is used in this event: <input type="button" name="btn" onclick="openWindow()"value="Open a new window" />

I can generate the new window fine. I just can't close it if the parent window is closed.

View 1 Replies View Related

Close All Child Window With Parent Window?

Nov 26, 2010

I have parent page with 10 child window and i want to close all child window when click on close session button on parent but first i need to check whether any child window open or not after that action should be done for close the child window.

View 4 Replies View Related

Close Window AND Go To New Page In Parent Window

Nov 2, 2004

I have a product that has many features. Clicking on a feature opens a popup window with explanation. There is a js Close Window link in each. All is fine so far.

Now in one popup window there is a reference to a different page of the main website. Is it possible to have a single text link both CLOSE the popup AND go to a new page in the parent window?

View 3 Replies View Related

Possible To Close All Child Window With Parent Window?

Nov 29, 2010

I want to close all child window with parent window. First i want to detect whether any child window open if open then it should be close after click close button on parent window.

View 8 Replies View Related

Close Pop-up Using Window.close()

May 16, 2009

I am using the following code in to open a pop-up window (in Flash hence the actionscript tags ..):

This is working fine. My problem is how to close this window from other pages on the website.

I have tried:

And it is not working. What would be the correct javascript to use to close the pop-up window that is opened using the code above?

View 4 Replies View Related

Web Page Refuses To Work In IE8?

Oct 29, 2011

I'm trying to code a website that will read data from an Excel file (stored either locally or elsewhere) and input a row of data (searched based on a Drop-Down List) into a table on the web page itself. Every time I open the page (it's currently stored on my local drive, on a laptop running Windows 7) in IE8, though, I get the error "Automation Server Can't Create Object" and nothing happens. The Excel file doesn't get opened and the table is blank. Thing is, though, I tried opening the same web page on another computer with IE6 and Windows 2000, and the Script works perfectly there.

I've been searching for a solution to this for a week, and some people suggested elsewhere that it's a problem with IE8's security settings. I lowered them as far as they'll go and enabled Running the Script Not Marked As Safe for all possible zones, same result, the Script refuses to run with the "Automation Server Can't Create Object" error. Here's the applicable lines of code:

function loadData() {
// try {
var Excel, Book;[code]...........

I'm completely stumped, everyone. Is it some obscure setting I'm forgetting to check in IE8, is my Java not fully updated, or what is it? Again, it works perfectly on my old Windows 2000 w/ IE6 computer, but not on a recent Windows 7 laptop with IE8.

View 3 Replies View Related

JQuery :: Gallery Refuses To Work

Apr 29, 2011

look at my page with a jQuery gallery that refuses to work, however, it works perfectly on my local computer. View Page [URL] What is the problem, and how do I fix it?

View 1 Replies View Related

HTML Textarea Refuses To Cooperate

May 13, 2003

So I got six textareas that are read-only.

Maybe I'm confused, but textareas support onFocus events, correct?

Furthermore, I've got a radio group that has an onChange event. Something like onChange="f(1);"

When a button is selected, the JavaScript function kicks in :

function f(n) {

var x = window.document.forms[0]
var y = new Array()
y[0] = 6

if (n == 1) {

x.text_field.value = y[0]

}

}

This should pop the number 6 into the text_field (which is a textarea), should it not?

View 6 Replies View Related

JQuery :: On Click Refuses To Fire Function ?

Feb 28, 2011

The function "setEqualHeight" fires on document ready and works well. It sets two columns to equal height. The problem is that I have tabs and accordions in the columns and therefore need to recalculate the column heights after the document is loaded: I try on click but nothing happens. Why?

This works fine:

This does'nt work:

View 12 Replies View Related

Window.print(); In Safari!?

Aug 11, 2004

i'm trying to send a html page directly to the print preview and bypass opening it in a new window. i've found a good solution by having a frameset with 2 rows. the top row is relative while the bottom row is 1 pixel height (hidden at the bottom). the user clicks a print button in the main top frame and it loads the html page that needs to be printed in the bottom hidden frame. on the print file, i included:

<body onload="window.print();">

therefore, the code above initiates an instant print preview. the problem is that it doesn't work in safari (osx). instead of printing the specific frame that the page is in, it print the frameset at the _top of the browser window.i tried changing the location to this., parent.window, etc...but, none worked.

View 3 Replies View Related

Visual Studio 2008 Refuses To Let Me Open JS Files?

Apr 30, 2009

Anyone here using Visual Studio 2008 to edit Javascript files? Wheneven I try to edit a .JS file (regardless of whether I've created it inside VS2008 or imported it), I get the tab with the file name, but the content doesn't update. I just see the contents of the previous tab, and if I type something, press save, rename the .JS file to something else and open it again, it turns out whatever I typed in is there.

If I "Open with..." the file, selecting source code editor instead of the default script editor, the file shows up fine, and I can work with it, but sadly without intellisense and color mark-up... Which sort of defeats the whole point of buying VS2008. I've tried the repair option from the VS2008 DVD, but no difference.

I'm using VS2008 v9.0.30729.1 SP1 on a swedish XP Pro SP2, tried restarting VS2008, rebooting etc, nothing helps. One workaround for me is to enclose the javascript in HTML "<script>" tags and renaming the file .htm and include it that way, but that's... ugly and ..

View 2 Replies View Related

Window.opener.location On Safari

Jul 30, 2005

I am trying to use the window.opener.location code from a link on my popup window to change the webpage in the window that opened my popup. It works on ie/firefox, but doesnt work on safari.

function changepage(id) {
window.opener.focus();
//window.opener.location('http://www.mysite.com/index.php?id='+id);
window.opener.location.pathname = 'index.php?id=' + id;
self.close();
return false;
}

Now i've tried the link with both <a href="#" changepage(35);"> and <a href="javascript:changepage(32);"> but safari doesnt want to touch the opener page. Do you know of any workaround/hack to get this to work? If not, is there a way to check to see if the user has safari and change the code to opening the page in a new window?

View 4 Replies View Related

Window.open Changes Focus In Safari?

Mar 24, 2011

I use a cookie to keep track of a particular window (using window.name), lets call this the main window. I use the window to distribute data returned from the server.

I use window.open("",mainWindowName) to get the reference to the main window object.

The problem is in nearly all browsers this works fine (focus stays on the current window), however in Safari, window.open also sets focus to that window (mainWindowName).

Of course I can reset focus back to the current window in Safari, but there is a quick flash of windows focus changing and it doesn't look good.

View 2 Replies View Related

Window.dialogArguments Not Supported In Safari

Jun 16, 2011

I am using window.dialogArguments in safari(5.0.5) but it is not supporting.Is there any replacement for this in safari?

View 2 Replies View Related

Window.closed Not Working In Safari?

Jun 25, 2010

I'm opening a new window with window.open in javascript and i'm keeping his reference to make focus on it or detect if the window is closed or not.My code is working well in Firefox and Chrome (execpt the window.focus, but there's already an issue in chromium: [URL]

In Safari window.open and window.focus works well. But window.closed has a strange behaviour. If I close the new window without navigating in it, window.closed works after closing the window. But if a navigate to another page, window.closed return false, even after closed the window.Is there a way to keep the reference on my new window event if the user navigate to another page ?

here is a sample of my code (I use jQuery 1.4.2):

Code:

MyBrowser = $.klass({
window_ref: null,
initialize: function() {

[code]....

View 1 Replies View Related

Window Close

Jul 20, 2005

I need a popup window to close after 10 seconds. I have 2 ideas, and
neither work.

<META HTTP-EQUIV='Refresh' CONTENT=&#3910;
URL=javascript:this.window.close()'>

or...
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function closeWin() {
window.close();
}
// End -->
</SCRIPT>
</head>

<body bgcolor="#ff0b11" onLoad:"javascript:closeWin()">

View 1 Replies View Related

JS Close Window

Sep 27, 2001

I urgently need a piece of JS that will close the window when a user clicks a button.
Using window.close works but it gives an alert box to ask the user if they want to close the window. Is there a way around this?

View 6 Replies View Related

Close A Window Or Two

Mar 3, 2007

i have this function that closes a window

function closeAll() {
if (myWin && myWin.open && !myWin.closed)
{
myWin.close();
}
}

how do i work in antoher window in there "myOtherWin" so that when this function is called both windows are closed myWin and myOtherWin, regardless which or both are opened?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved