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

event exception

<table onclick="do_something()">
<tr>
<td id=1 onclick="do_something_else()"></td>
</tr>
<tr>
<td id=2></td>
</tr>
</table>

how can i make a do_something event that only happens when the
do_something_else event doesnt happen by clicking for example on the
second td ?

Mar 22 '07 #1
3 1347
On Mar 22, 12:04 pm, "gert" <gert.cuyk...@gmail.comwrote:
<table onclick="do_something()">
<tr>
<td id=1 onclick="do_something_else()"></td>
</tr>
<tr>
<td id=2></td>
</tr>
</table>

how can i make a do_something event that only happens when the
do_something_else event doesnt happen by clicking for example on the
second td ?
For a full explanation, read:
Quick explanation: pass the event to the function an use IE's
cancelBubble property or the W3C stopPropagation() method, see below.

<script type="text/javascript">

function fn0() {
alert('hi from fn0');
}
function fn1(e) {
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
alert('hi from fn1');
}
</script>

<div onclick="fn0();"
style="border: 1px solid red;">A div
<p onclick="fn1(event);"
style="border: 1px solid blue;">A paragraph</p>
</div>
--
Rob

Mar 22 '07 #2
On Mar 22, 12:53 pm, "RobG" <r...@iinet.net.auwrote:
[...]
For a full explanation, read:
Ooops, forgot the link:

<URL: http://www.quirksmode.org/js/events_order.html >
--
Rob
Mar 22 '07 #3
Thx :)

Mar 23 '07 #4

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

Similar topics

15
by: Pohihihi | last post by:
This might sound little stupid to many but I was thinking that when we can use object why we really need event args to pass in any functions e.g. bool MyFunction(object sender, System.EventArgs...
3
by: Michael Schwarz | last post by:
Hi, from time to time I get following error message with my ASP.NET 2.0 web application in the event log: An error occurred executing the configuration section handler for system.web/identity. ...
0
by: gunjanhshah | last post by:
Hello My system reports the following application event log. The log is due to my web application which is built upon asp.net and sql server 2000 and uses Active directory users to authenticate....
4
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
1
by: =?Utf-8?B?YnJlbnQ5NjA=?= | last post by:
Environment: ASP.NET 2.0, SQL Server 2005, C#, Visual Studio 2005 In my Session_End event, I am executing a stored procedure to update a database table that is used to log user sessions. When...
8
by: Karsten Schramm | last post by:
Hi, when I run the following code: using System; namespace ConsoleApplication22 { class Program {
1
by: brad.serbus | last post by:
I am trying to figure out a way to have health monitoring throw different Event IDs into the event log, and am having a hard time. None of the customization that I have looked through so far has...
3
by: tim.cavins | last post by:
We have a page on our Intranet A main.aspx that is calling a webservice on another computer B. The intranet page loads fine and displays the data from the webservice but we keep getting error...
24
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
1
by: anithaapr05 | last post by:
I have got the warning in event viewer when i wrote the code in global.asax session_end(). When the user sessions time out, the Session_End event fires successfully.But i got the waring in event...
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
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?
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
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...
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.