Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 20th, 2006, 04:58 AM
anandkanatt anandkanatt is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: In everybody's mind
Posts: 74 anandkanatt User rank is Private First Class (20 - 50 Reputation Level)anandkanatt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 7 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to anandkanatt
Exclamation Firefox XUL > event bubble problem

Hi,
Does someone know how to prevent the event bubbling in firefox I am using Firefox version 1.5.0.7 and i have tryed a hell lot of commands to stop the event bubbling ... but nothing worked out... I am pasting the code below pls go through it ... i need some help very badly coz i need to be able to stop the Table Row and Table onClick events from firing when the image inside it is clicked...

Pls hlp

Regards
Anand

CODE::

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function img()
{
	alert('image');
	//event.preventBubble();
	//event.stopPropagation();
	//event.cancelBubble = true;
	//return false;
	alert(event.bubbles);
}
function tr()
{
	alert('Table Row');
	return false;
}
function t()
{
	alert('Table');
	return false;
}
function load()
{
	//event.preventDefault();
	//event.stopPropagation();
	//event.cancelBubble = true;
	//event.returnValue = false;
}
</script>
</head>

<body onload="load();">
<table id="t" width="50%" border="1" onclick="t();">
  <tr id="tr" onclick="tr();">
    <td><a href="#" onclick="img();" id="img"><img src="file:///D|/Site Files/images/css_design_01/gblnav_left.gif" alt="XUL" width="5" height="32" border="0" /></a></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

Reply With Quote
  #2  
Old September 20th, 2006, 01:57 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,358 ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 3 Days 5 h 53 m 37 sec
Reputation Power: 291
Facebook
Comments on this post
anandkanatt agrees!
__________________
Support requests via PM will be ignored!
Route of Queue | The General FAQ Thread | HOW TO POST A QUESTION

Sign up with Matched.co.uk and earn up to £15 per website every month!


Reply With Quote
  #3  
Old September 21st, 2006, 12:50 AM
anandkanatt anandkanatt is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: In everybody's mind
Posts: 74 anandkanatt User rank is Private First Class (20 - 50 Reputation Level)anandkanatt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 7 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to anandkanatt
Thumbs up Thank you ...

Thanks for that post ... it was a life saver ... THANKS .....

I used the info from that link you post to get my page work ... this is the code that works ... i am pasting this so that someone else looking for a clear solution to cancel bubble event wont have to search too long ... like what i did ..

This is the solution ...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function img(evnt)
{
	alert('image');
	var e = (window.event) ? window.event : evnt;
	e.cancelBubble = true;
	return false;
}
function tr(evnt)
{
	alert('Table Row');
	var e = (window.event) ? window.event : evnt;
	e.cancelBubble = true;
	return false;
}
function t(evnt)
{
	alert('Table');
	var e = (window.event) ? window.event : evnt;
	e.cancelBubble = true;
	return false;
}
</script>
</head>

<body>
<table id="t" width="50%" border="1" onclick="t(event);">
  <tr id="tr" onclick="tr(event);">
    <td><a href="#" onclick="img(event);" id="img"><img src="../../../Site Files/images/css_design_01/gblnav_left.gif" alt="XUL" width="5" height="32" border="0" /></a></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>


This is another example to the problem ...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function foo(evnt)
{
	var e = (window.event) ? window.event : evnt;
	alert(e);
	e.cancelBubble = true;
}

function bubbletest()
{
	alert("I AM BUBBLING");
}
</script>
</head>

<body>
<table id="t" width="50%" border="1" onclick="bubbletest();">
  <tr id="tr" onclick="foo(event);">
    <td><a href="#" onclick="foo();" id="img"><img src="../../../Site Files/images/css_design_01/gblnav_left.gif" alt="XUL" width="5" height="32" border="0" /></a></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>


Regards
Anand
Comments on this post
ChiefWigs1982 agrees: Glad you got it working.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Firefox XUL > event bubble problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway