Current location: Hot Scripts Forums » General Web Coding » JavaScript » Safari Popups


Safari Popups

Reply
  #1 (permalink)  
Old 02-16-04, 05:03 PM
ornoc ornoc is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Safari Popups

Hey everyone,

I'm currently using this code:
Code:
<script LANGUAGE="JavaScript" TYPE="text/javascript>
<!--
var newWindow;
  function opener(url,width,height,name)
{
			name = name.replace(' ','+');

			var thirdAttr = "screenX=100,screenY=100";
			thirdAttr += ",width=" + width + ",height=" + (height + 16);
			thirdAttr += ",top=100,left=100";
			newWindow = window.open("showmovie.php"+"?x="+width +"&y="+ height +"&url=" + url +"&name=" + name, "display", thirdAttr);
			if (window.focus) {newwindow.focus()}
}
// -->
</script>
called by

Code:
<a href="showmovie.php?x=320&y=240&url=O-Timeline.mp4" target="A Brief History of Lame" onclick="opener('O-Timeline.mp4',320,240,'A Brief History of Lame'); return false">pop-up</a>
to popup a new window. The problem is that Safari doesn't popup but instead reverts back to the target attribute as if it was a browser that didn't support Javascript. The wierd thing is, I have gone to other webpages (like Quirksmode)and their popups worked fine in Safari. If I view the source of the page, it looks just like mine.

Is there some glaring mistake I'm missing or maybe something specific with Safari?

btw: The popups work exactly as expected in all other browsers.

Thanks a Bunch,

Ornoc
Reply With Quote
  #2 (permalink)  
Old 03-02-04, 11:33 AM
ornoc ornoc is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
solution

In case anyone cares, I found the solution on my own.

The problem was that the popup function was called opener() which is a reserved word in Javascript. The script worked fine in all other browsers, so I guess everyone except Safari ignores it.

Anyway, I changed the function to popitup() and problem solved.

-Ornoc
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 02:10 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.