473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to pop up a new windows from a a link

<a ><span id="TopMenuBar1_labelHelp"
OnClick="window.open('http://test/admin.htm', 'PSHelp', 'toolbar=no,
directories=no, location=no, status=no, menubar=no, resizable=no,
scrollbars=yes, width=780, height=530')" title="Click here to open the
PS online guide." onMouseOver="this.style.cursor='hand'"
style="font-weight:bold;">Help</span></a>

Apr 10 '06 #1
1 1369
Zif
an******@hotmail.com said on 11/04/2006 1:25 AM AEST:
<a ><span id="TopMenuBar1_labelHelp"
What is the point of the A element here? It performs no useful function
at all.
OnClick="window.open('http://test/admin.htm', 'PSHelp', 'toolbar=no,
directories=no, location=no, status=no, menubar=no, resizable=no,
Allowing code to autowrap frequently introduces errors, as here.

The feature string should not contain any spaces. Typically, just
specify the features you want, the rest will be omitted if the browser
permits:

onclick="window.open('http://test/admin.htm', 'PSHelp',
'scrollbars,width=780,height=530');"
To learn about opening windows, try the following link and the tutorials
listed at the bottom of the page:

<URL:http://developer.mozilla.org/en/docs/DOM:window.open>

scrollbars=yes, width=780, height=530')" title="Click here to open the
PS online guide." onMouseOver="this.style.cursor='hand'"
The cursor property 'hand' is proprietary MS for IE (though some other
browsers may implement it), use 'pointer' (W3C CSS compliant). But if
an A element is used as below, the onmouseover isn't necessary.

style="font-weight:bold;">Help</span></a>


Is there a question here? The normal way to implement pop-ups is to use
an A element with an href attribute of the link that will be opened in
the popup. Use a separate script that can be run from any A element or
onclick.

Return a suitable value from the script, and return the script's exit
value from the onclick so that the link isn't followed if the script
runs successfully (presumably the link will open in a popup if it does).

This also allows the link to be opened in a tab if the user wants
without opening the popup.
<script type="text/javascript">
var popupWindow;
function popWin(url)
{
if (!popupWindow || popupWindow.closed){
popupWindow = window.open('','popupWindow',
'scrollbars,width=780,height=530');
}
popupWindow.location = url;

if (popupWindow && popupWindow.focus) popupWindow.focus();

return !popupWindow;
}
</script>

<a href="http://test/admin.htm"
onclick="return popWin(this.href);"
title="Click here to open the PS online guide"
style="font-weight:bold;">Help</a>
--
Zif
Apr 11 '06 #2

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

Similar topics

44
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
7
by: Sunil Varma | last post by:
Hello all, I wrote a Windows Service in VC.NET 2005 I want to debug the solution. I tried as mentioned in the following link. ...
6
by: JW | last post by:
I have a lousy little Python extension, generated with the generous help of Pyrex. In Linux, things are simple. I compile the extension, link it against some C stuff, and *poof*! everything...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Programs dealing with autoruns Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list programs that help me to view/modify the autoruns...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.