Hi, i have tried this code in FireFox and it works great. However , it seems to fail in IE6/7. I have no idea and looking for help here. Please advice. Thank you. - <a
-
ONCLICK="window.open('http://www.google.com,'height=180','width=250','location=no','menubar=no','resizable=no','scrollbars=yes','status=no','toolbar=no')" href="javascript:void(0)">
-
Whois Agent local</a>
6 6816
This code is programmed bad. Why do you need an "onclick"-event if your "href" is already reacting to the click? You disabled the clicking by using href="javascript :void(0)". So no wonder the browser gets confused and reacts differently on this error.
Just use - <a href="javascript:window.open(...)>Whois Agent local</a>
and it should work in all browsers.
If it still does not work, then check your configuration (for example if you have disabled javascript in your brower)
Hi, i have tried this code in FireFox and it works great. However , it seems to fail in IE6/7. I have no idea and looking for help here. Please advice. Thank you. - <a
-
ONCLICK="window.open('http://www.google.com,'height=180','width=250','location=no','menubar=no','resizable=no','scrollbars=yes','status=no','toolbar=no')" href="javascript:void(0)">
-
Whois Agent local</a>
Thank you Chaarmann, Your method seems to be more effective way to the javascript. However, i am still facing the same problem even using your suggested way.
here is my function in php: - function open_me1(){
-
window.open('http://www.google.com','height=300','width=250','location=no','menubar=no','resizable=no','scrollbars=yes','status=no','toolbar=no');
javascript : - <a href="javascript:open_me1();">Click To google</a><br />
I manage to call the function in FireFox with no error message recorded in Error Console. On the other hand, IE6/7 the error message is invalid argument. This is weird.
window.open() only has 3 or 4 parameters. The first is the URL. The second is the name of the window. The third specifies the properties. You've split these up into their own arguments - they should be grouped together as one. See, for example, this link.
This code is programmed bad. Why do you need an "onclick"-event if your "href" is already reacting to the click? You disabled the clicking by using href="javascript:void(0)".
You should always use the href of a link in case JavaScript is disabled. It should really point to a real URL (in this case google.com). In the onclick, you can prevent the browser following the href link using return false. If you program like this, it will work whether JavaScript is enabled or not.
You should always use the href of a link in case JavaScript is disabled. It should really point to a real URL (in this case google.com). In the onclick, you can prevent the browser following the href link using return false. If you program like this, it will work whether JavaScript is enabled or not.
Cool, I learned something new today. Especially that you can disable the href by returning "false" in your onClick. But that also means that the onClick is executed first. Is this the case in all common browsers?
Cool, I learned something new today. Especially that you can disable the href by returning "false" in your onClick. But that also means that the onClick is executed first. Is this the case in all common browsers?
Yes, if JavaScript is enabled. If it's disabled, the href link will be followed. See these usability issues/tips for more information.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andrew Poulos |
last post by:
If I use this code to maximise a browser window:
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
it works but on Windows the user can have a taskbar visible and the
browser...
|
by: Derek Erb |
last post by:
I am banging my head against the wall with this one. The following
code snippets work perfectly fine in MSIE6. But produce an error in
Firefox and do not work at all.
BROWSER.HTM
<HTML>
.......
|
by: Dominic Tocci |
last post by:
I'm searching for a way to use window.open on my web page to open a window
in firefox that allows the sidebars to work (bookmarks, history, etc).
When I use the following:
var...
|
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...
|
by: tochiromifune |
last post by:
Hello
The window.open method brings my window to the top only if it is new. If
it's being reused, the window does not come to the foreground (with IE 6 it
does).
Is there a new way in...
|
by: kosmodisk |
last post by:
Hi,
I'm having problem accessing javascript-created elements from opened
window. This occurs only when I'm including another files in opened
window, javascript or css. When I comment out...
|
by: Andre |
last post by:
With Firefox 1.5+, I used the following code to close a window/tab:
===
<html><head>
<script language="javascript" type="text/javascript">
function closeWindow() {
window.open('','_parent','');...
|
by: Howard Rifkin |
last post by:
Hi,
I my Javascript I popup an authentication window using the command;
unamePasswdWindow = open("auth.html","","width=500,height=100");
This works fine in IE, and in Firefox 2.x on...
|
by: amymcdo3 |
last post by:
Hi Everyone,
I have a popup window that opens when clicking a link. The pop up window asks a question and supplies two buttons, Yes and No. The buttons are images and when the user clicks the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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: 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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |