[thelist] Window Popup Problem

Bruso, John jbruso at SHERIDAN.EDU
Fri Feb 17 12:56:45 CST 2006


Hi Chris,

Target=_blank in the form tag would be great if I were to have every
link that points to the form pop up in a new window.. but alas, life is
so complicated, and I do not :P Some links need to point to the form and
target the same window and some links need to point to the same form and
target a new window.

This kinda works: 
onclick="var f=document.logonForm;
f.url.value='http://library.alldatapro.com'; f.target='_blank';
f.submit();"

But, if I pop up a window and then close it and then click on one of the
links that should not popup a window, it will.

It's like some variable is being set but not destroyed when the child
window is closed.

That make sense?

try it: http://dev.sheridan.edu/Test/library/library.htm

click on the ALLData link... and it will work fine, staying in it's own
window.. then, click the popup icon to the right.. and it will popup the
link into a window... great so far.. but then, close that child window
and click o the AllData link again and it will pop up a window instead
of staying within its own.


    -------------------------
John Bruso
IS Developer
Sheridan College
ph  307.674-6446-2608

  
	
 
 
 

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Chris at globet.com
Sent: Friday, February 17, 2006 11:10 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Window Popup Problem

John

> Thanks for your help with this. In reference to using the javascript..
> I'm not worried about users who don't have javascript... this 
> is a controlled environment and everyone will be using 
> javascript enabled browsers.

What if the system grows, and javascript errors are introduced? This
would prevent the window from opening at all. As the method that I
outlined would have (as far as I can see) no impact at all on the way
that your system works when functionaing as planned and a negligeable
outlay to implement - perhaps the question to consider is "Why not?"
rather than "Why?".

> The reason why there is a # in the href, and I'm using the 
> onclick event is because I have about 50+ href links on this 
> page and each of them call the same form, carrying a 
> variable. I'm not too knowledgeable about Javascript, but I 
> got this to work.

What does your form do with the variable value? Are you
over-complicating things? How do you verify that the URI that is being
supplied is a valid URI for the system to use? Are you positive that
your system is not vulnerable to an XSS attack?
http://www.cgisecurity.com/articles/xss-faq.shtml

In addition, (IMHO) if you have more than one javascript statement to be
executed within an event handler, you should be writing a function and
calling the function in the event handler.

> So, I guess, to Chris's point, I need a way of targeting the 
> new window "_blank" instead of itself "#". 

Set the 'target' attribute of the form to '_blank'.

Chris Marsh
Web Developer
http://www.globet.com/
Tel: +44 20 8246 4804 Ext 828
Fax: +44 20 8246 4808

Any opinions expressed in this email are those of the individual and not
necessarily the Company. This message is intended for the use of the
individual or entity to which it is addressed and may contain
information that is confidential and privileged and exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please contact the
sender immediately and delete it from your system. 
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 



More information about the thelist mailing list