473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.captureE vents(Event.CLI CK) javascript error

Hi
I am trying to add an event handler to the window so that If the user clicks
the close window button, it creates a popup to tell the user it should use
the log out button before closing window.

When I try to this:
window.captureE vents(Event.CLI CK);
I get a javascript error saying the "Event" is undefined.

Here is how I use the code
<html>
<head>
<script language="JavaS cript" type="text/javascript">
<!--
window.captureE vents(Event.CLI CK);
window.onclick= test

function test(event){
//do something
}

// -->

</script>
</head>
<body>

Running Win2000, IE 6.02. Same result on XP.
Anyone have ideas?
thanks
Harry
Nov 18 '05 #1
2 3383
IE is not w3c compliant and does not support the w3c captureEvents also the
windows.Event object differs between IE and w3c browsers.

try this link to learn what you need to know

http://www.mozilla.org/docs/web-deve...bdhtml.html#10

-- bruce (sqlwork.com)

"harry" <NO************ *****@hotmail.c om> wrote in message
news:eW******** ******@TK2MSFTN GP10.phx.gbl...
Hi
I am trying to add an event handler to the window so that If the user clicks the close window button, it creates a popup to tell the user it should use
the log out button before closing window.

When I try to this:
window.captureE vents(Event.CLI CK);
I get a javascript error saying the "Event" is undefined.

Here is how I use the code
<html>
<head>
<script language="JavaS cript" type="text/javascript">
<!--
window.captureE vents(Event.CLI CK);
window.onclick= test

function test(event){
//do something
}

// -->

</script>
</head>
<body>

Running Win2000, IE 6.02. Same result on XP.
Anyone have ideas?
thanks
Harry

Nov 18 '05 #2
harry wrote:
Hi
I am trying to add an event handler to the window so that If the user clicks
the close window button, it creates a popup to tell the user it should use
the log out button before closing window.

When I try to this:
window.captureE vents(Event.CLI CK);
I get a javascript error saying the "Event" is undefined.

Here is how I use the code
<html>
<head>
<script language="JavaS cript" type="text/javascript">
<!--
window.captureE vents(Event.CLI CK);
window.onclick= test

function test(event){
//do something
}

// -->

</script>
</head>
<body>

Running Win2000, IE 6.02. Same result on XP.
Anyone have ideas?
thanks
Harry

Wrong group Harry, this is for asp.NET only.

window.captureE vents(Event.CLI CK) is a NON IE thing.

//Rutger
Nov 18 '05 #3

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

Similar topics

5
20778
by: Jeff Thies | last post by:
I have this IE specific bit of code for finding the originating node: var obj=window.event.srcElement; How do I do that cross browser (Opera, NS, Safari...)? Is there a standard DOM method? I seem to recall NS worked something like this: onmousedown=handleThat;
2
6099
by: RobG | last post by:
I have a set of HTML elements that I add an onclick event to at runtime. All it does is get the contents of an element using innerHTML. It all works fine in Firefox, but I can't get it to work in IE. No doubt I have a really simple error.... help! window.event returns an object, but window.event.toElement returns null.
3
27192
by: Søren M. Olesen | last post by:
Hi In IE there seem to be a global variable window.event, holding the current event....however this dowsn't work in FireFox... is there a similar way to get the current event?? TIA Søren
5
5212
by: chad.a.morris | last post by:
Hi everyone, I didn't know how to sum this up very well for the title, but hopefully the person(s) will come along who can help. I'm trying to use the window.event.clientX value for positioning a javascript routine, but I'm having trouble. When the javascript routine comes up, it comes up in a certain position based on window.event.clientX. However, the user could click on something in the script display (say, like a menu, or a...
9
6840
by: mike | last post by:
I have this script executing <script> function mike_test(event) { x = window.event.clientX; alert(x); } </script> <iframe src="blank.html" id="my_iframe1"> </iframe>
9
17878
by: Ja NE | last post by:
(I'm not a programer, I have learned enough php to build my cms, but that doesn't make me coding guru, so please excuse me if I'm asking something trivail...) well, I have one upload form where I want my users to choose category for their picture. they are alowed to upload more then one picture at time. and there is a problem. I have to use <select name="name"> for my php script, so I have added id to the select tag <select...
1
2533
by: den2005 | last post by:
Hi everybody, I am new in javascript. I am working on resizing a control like Image by dragging it to a desired size at runtime. Now, my onmouseover event is working ok where the cursor type is change when position on particular part of control. But the function being called by my onmousedown event has error telling me a syntax error on line 90 (mouseDragImage). What is wrong with it? Thanks in advance. den2005 function...
5
6486
by: anEchteTrilingue | last post by:
Hi everybody. Thank you for reading my post. I am having trouble getting "this" to work in all versions of IE (it's fine in Firefox, opera, konqueror, etc). What I would like to do is add an event listener to an element to change its border on mouseover and mouseout. I don't want to use CSS to do this (long story). The problem is that "this" does not work at all in IE for me. I tried to do a try/catch statement and use...
5
8530
by: dipalichavan82 | last post by:
i m wrinting javascript. on button click i am calling a javascript function that returns (x,y) coordinate of point where i clicked. i used window.event.x and window.event.y it works fine in IE but not in mozila ..why so any solution thnx
0
9568
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
9389
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...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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
8257
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...
1
6801
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
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...
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.