473,699 Members | 2,147 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 3374
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
20776
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
6097
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
27190
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
5207
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
6837
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
17875
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
2532
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
6485
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
8528
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
8705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8628
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9054
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...
0
8899
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
7785
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...
0
5884
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
4391
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...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.