473,386 Members | 1,823 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,386 software developers and data experts.

why doesnt ONCLICK work from some machines?

Hi all

Are there any compatibilty issues associated with teh following command?

<div onclick="open('http://www.mysite.com.htm','','')">Main page </div

It worked on a PC butnot on a MAC (bith with IE).

Thanks

atskud
Jul 23 '05 #1
2 1370
Andrew wrote:
Hi all

Are there any compatibilty issues associated with
teh following command?

<div onclick="open('http://www.mysite.com.htm','','')">Main page </div
Yes.
It worked on a PC butnot on a MAC (bith with IE).


The unqualified identifier - open -, executed form on event handler,
will be resolved against the scope chin of the event handler function.
Browsers construct different custom scope chains for the event handling
functions that they construct (from attribute strings), and those scope
chains may or may not include the - document - object, which has an -
open - method of its own. If Mac IE places the - document - on the DIVs
onclick handler's scope chain then the method called will be -
document.open - instead of - window.open -. Not relying on identifier
resolution against the scope chain when placing code in HTML event
handling attribute strings avoids the problem (i.e. use - window.open -
in this case).

All calls to - window.open - may be subject to pop-up blocking
mechanisms of various sorts, and thus may not work on all
machines/configurations even with the same browser.

Very old browsers (e.g. Netscape <= 4) may not implement onclick
handlers on normal DIV elements.

Richard.
Jul 23 '05 #2
In article <ae**************************@posting.google.com >,
le******@yahoo.fr enlightened us with...
Hi all

Are there any compatibilty issues associated with teh following command?

<div onclick="open('http://www.mysite.com.htm','','')">Main page </div

It worked on a PC butnot on a MAC (bith with IE).


Try
<div onClick="window.open('http://www.mysite.com/page.htm','','');">Main
</div>

Mac IE may not support just using open without window in front.
Just a guess. I don't have a Mac to test it on.

--
--
~kaeli~
If that phone was up your a$$, maybe you could drive a
little better!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

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

Similar topics

1
by: Spidah | last post by:
Hi folks Can somebody help with a problem I am having with onclick events. If I set up a link link this: <a href="#" onclick="if(confirm('Do you wish to...
13
by: Sheperd | last post by:
Hey everyone, I have this browser detect script and the validator is having problems with it, im trying to validate a page for XHTML 1.0 Transitional If you have any ideas or suggestions they...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
2
by: temikolawole | last post by:
I have a user control on every single page on my website. Its called sidenav.ascx. It has a sidemenu and some extras. One of the extras is a login div that shows only when one of the images on the...
12
by: effendi | last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac Safari, Works in all but the Safari. What can I do to rectify this? function processBackground(){ for (n=1;n<11;n++) { ...
2
by: cluce | last post by:
i have a table sorting feature on my website that works everywhere else except in firefox. but the example code does work in firefox. this has me stumped. The problem is the links in the table...
1
by: reemamg | last post by:
I've two frames in a page. On the left Frame i've buttons , if we click on button the particular pages will be loaded in the middle Frame. This code works perfectly in Firefox but not in IE ... ...
3
by: Tahir | last post by:
Hi, i am delevoping an ASP.NET website which worked well on my old web host and now working on localhost but now it doesnt works on my new host. i have new registered and ftp the files that...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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.