473,729 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open set size window from embedded email

I have a news video that I am sending out for a client. There are embedded
links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?

Thanks.

### START CODE ###
<SCRIPT language=javasc ript type=text/javascript>
<!--
/*************** *************** *************** *************** **********
Author: Eric King
Url: http://redrival.com/eak/index.shtml
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
*************** *************** *************** *************** ***********/
var win=null;
function NewWindow(mypag e,myname,w,h,sc roll,pos){
if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n
..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen
..height-h)-75)):100;}
if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi
on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
else if((pos!=center && pos!=random) ||
pos==null){Left Position=0;TopP osition=20}
settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ '
,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b
ar=no,resizable =no';
win=window.open (mypage,myname, settings);}
// -->

function blurAnchors(){
if(document.get ElementsByTagNa me){
var a = document.getEle mentsByTagName( a);
for(var i = 0; i < a.length; i++){
a[i].onfocus = function(){this .blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>
Jul 23 '05 #1
5 2289


Sean Berry wrote:

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email? <TD width=400><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>


Probably there is no script enabled in the email client so that the link
is simply opened. Just a guess, but generally don't expect script in
HTML emails to work.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2
How about... having a link in an email open a browser window... that page
opens a popup, then closes itself, leaving only the popup?

Any suggestions on code to open the popup automatically, then close the main
window?

Thanks...
"Sean Berry" <se********@cox .net> wrote in message
news:sohEc.1508 $876.1171@fed1r ead07...
I have a news video that I am sending out for a client. There are embedded links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?

Thanks.

### START CODE ###
<SCRIPT language=javasc ript type=text/javascript>
<!--
/*************** *************** *************** *************** **********
Author: Eric King
Url: http://redrival.com/eak/index.shtml
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
*************** *************** *************** *************** ***********/
var win=null;
function NewWindow(mypag e,myname,w,h,sc roll,pos){
if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n ..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen .height-h)-75)):100;}
if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
else if((pos!=center && pos!=random) ||
pos==null){Left Position=0;TopP osition=20}
settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ ' ,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b ar=no,resizable =no';
win=window.open (mypage,myname, settings);}
// -->

function blurAnchors(){
if(document.get ElementsByTagNa me){
var a = document.getEle mentsByTagName( a);
for(var i = 0; i < a.length; i++){
a[i].onfocus = function(){this .blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>

Jul 23 '05 #3
I figured most of this out....

My only problem now is that when the code executes to close the window, in
IE on Win, it wants you to confirm closing the window.

Anyway to bypass this? It works great in IE on Mac.
"Sean Berry" <se********@cox .net> wrote in message
news:MTkEc.1670 $876.1026@fed1r ead07...
How about... having a link in an email open a browser window... that page
opens a popup, then closes itself, leaving only the popup?

Any suggestions on code to open the popup automatically, then close the main window?

Thanks...
"Sean Berry" <se********@cox .net> wrote in message
news:sohEc.1508 $876.1171@fed1r ead07...
I have a news video that I am sending out for a client. There are

embedded
links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the following code, but the popup window is not 400 x 400, it is whatever the browser size was last time it was opened. How can I set the absolute size from within this email?

Thanks.

### START CODE ###
<SCRIPT language=javasc ript type=text/javascript>
<!--
/*************** *************** *************** *************** **********
Author: Eric King
Url: http://redrival.com/eak/index.shtml
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
*************** *************** *************** *************** ***********/
var win=null;
function NewWindow(mypag e,myname,w,h,sc roll,pos){

if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n

..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen
.height-h)-75)):100;}

if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi
on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
else if((pos!=center && pos!=random) ||
pos==null){Left Position=0;TopP osition=20}

settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ '

,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b
ar=no,resizable =no';
win=window.open (mypage,myname, settings);}
// -->

function blurAnchors(){
if(document.get ElementsByTagNa me){
var a = document.getEle mentsByTagName( a);
for(var i = 0; i < a.length; i++){
a[i].onfocus = function(){this .blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>


Jul 23 '05 #4
Sean Berry wrote:
<TD width=400><A onfocus=this.bl ur()
This is a "trick" used to avoid the dotted outline around links. However, using
this "trick" removes the possibility of using anything other then a mouse to
activate the link. Doing it with "this.blur( )" is a bad design. Removing the
focus indicator at all is a bad design, but if you insist on doing it, the way
you are doing it should be replaced by:

<head>
<style type="text/css">
a:focus {
-moz-outline: none ! important;
}
</style>
<script type="text/javascript">
function hideFoci() {
var a;
if (document.getEl ementsByTagName ) {
a = document.getEle mentsByTagName( 'a');
} else if (document.all && document.all.ta gs) {
a = document.all.ta gs('a');
}
if (a && a.length > 0 && typeof a[0].hideFocus != 'undefined') {
for (var i = 0; i < a.length; i++) {
a[i].hideFocus = true;
}
}
}
</script>
</head>
<body onload="hideFoc i();">

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
I'm not sure why you've included an attribute of the <A> tag called "false" on
this link. I think you might have been modifying code and in fact meant:

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return false;"
href="...">Link text...

(ie - move the word false from it's position as an attribute of the <A> tag to
be the value returned by the onclick event)
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.bl ur()

onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>


Remove the onfocus event handler and move the "false" for this link as well.

--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #5
Sean Berry wrote:
I figured most of this out....

My only problem now is that when the code executes to close the window, in
IE on Win, it wants you to confirm closing the window.

Anyway to bypass this?
<news:40******* *******@Pointed Ears.de>
It works great in IE on Mac.
So IE on Mac is borken.
[Top post]


<http://jibbering.com/faq/#FAQ2_3>
PointedEars
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3850
by: Jayme Assuncao Casimiro | last post by:
Is there the possibility of not permiting the user of opening two windows of the same web site? Thanks +---------------------------------------------+ | Jayme Assuncao Casimiro | | Graduado em Ciência da Computação | | Estudante de Mestrado em Computação |
3
2375
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens the window... if i write the open window code in the page load, then the window gets open on 1 click and no session variable was saved... any ideas how to get around this... this is my code:
1
2540
by: Doug | last post by:
When opening a DOC file via a hyperlink, is it possible to force Microsoft Word to open in a specified-size window? For example, a 600x300 window? I realize that MS Word will 'remember' the window size and placement from the last instance that was created/exited. Help is appreciated. Thanks.
1
6843
by: sathyanrockie | last post by:
Plase tell me what is the difference between window.open and window.showmodelessdialog. Can we use window.showmodelessdialog in place of window.open?
19
4236
by: Sonnich | last post by:
Hi! I have used JS, but I am still new to it. I have something like this: oNewWindow = new Object(); oNewWindow = open("sonnich.xls","Qopen","resizable=yes,scroll=yes, status=yes, width=320px, height=470px",true); oNewWindow.focus();
3
4545
by: dibakar | last post by:
Hello I want to open a window using Window.showModalDialog once i click inside of a TextBox.And that window need to come just under the TextBox,so that it seems to a same control. So,what will be its code in javascript?
2
2126
by: tshad | last post by:
I have an aspx window that is going to open a window (javascript) and display a graphic. I want to resize the window to the size of the graphic before it actually displays - how do I do that? In my calling routine I have the following: *********************************** function OpenLogoPreviewWindow() { window.open('logoDisplay.htm','mywindow'); }
0
2037
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it an text imput field to asign this, open a mail client to send a mail to some people. All this, is made in php. In other words, user logs in, a window is open (after query) showing new appointments (set in other office), and each new appointment...
8
4255
by: vatz | last post by:
I am using Java to open a window application. i need to open it in a specified size. Please let me know how to do this...Thanks in advance... - Vatz
0
8925
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9288
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9154
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8156
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.