JQuery :: Event Bubbling On Button Not Working As Expected In Firefox?
Nov 19, 2011
I have a<button>element inside of which I have 2<span>elements. I have 2 attached jquery click event handlers for each of the span elements so I can do whatever I like for each click. This is all working fine in Chrome and the click event is captured in the correct order: first on any of the span elements and then the event bubbles up to the parent button element. The problem is that in Firefox the click event does not fire for any of the span elements, just the button event handler logs the event as being fired.[URL]..
View 4 Replies
ADVERTISEMENT
Oct 16, 2009
I wrote a simple javascript function but I cant get it to work upon a button click event because it keeps telling me that "object is expected" ? could you please identify where the error is? Heres my code
<html>
<head>
<title>Test</title>
<script type="text/Javascript" language="Javascript">
function output(){
alert("Hello world"); }
</script>
<head>
<body>
<input type="button" name="btnSubmit" value="submit" onclick="output();" />
<input type=button onclick="output();">
</body>
</html>
It keeps indicating me that there is an error when calling the method on button click.
View 7 Replies
View Related
Oct 23, 2009
I am trying to organise some code on a large project I'm doing which changes a lot of code around the page with submit forms. As jQuery doesn't have a live support for submit elements I thought I'd try my hand at event bubbling. It works nicely in firefox but isn't working at all in IE.
[code]
$('#data').submit( function(e) {
/* When a edit form is selected */
if (e.target.className == 'edit_link'){
//ajax request
}});
[/code]
I have a div with an id #data inside this div is a table with data and forms at the end of each of the row to edit parameters. When I click edit it loads a form in another div outside the #data one via ajax then the user can change the values and hit update (which has a class of .edit_link ) at which point it should reload the #data div. The reloading of the #data div is why I need some sort of live event to it. I've tried doing the way above and it works great in firefox but not in IE. Just to clarify the submit doesn't fire at all.
View 1 Replies
View Related
May 10, 2010
I'm checking for a radio button's value and hiding/showing a node based on that value, but it's not working right. Two radio buttons: one's value is yes, the other no. If you click on yes, the div shows up. When you click no, it hides, so that works.
But I have a list of checkboxes that also may or may not show that element based on the radio button selection, and it's this part that isn't working.
$('[name="'+obj.name+'"]:checkbox').click(function () {
aThroughS = ($('[name="'+obj.name+'"]:checkbox:lt(19):checked').length > 0),
tSelected = ($('[name="'+obj.name+'"]:checkbox:eq(19):checked').length > 0),
rSelected = ($('[name="'+obj.name+'"]:checkbox:eq(17):checked').length > 0),
[Code].....
View 1 Replies
View Related
Apr 30, 2009
Ive written this source
[Code]...
View 7 Replies
View Related
Jan 9, 2012
I'm in the process of integrating the google maps api into my application. Unfortunately, my events seem to be bubbling. If I open the google maps info window 3 times and click the next button respectively, on the forth time when I click the next button the next event will fire four times. How do I stop this?
$("#google_map_canvas").on("click", "#next", function() {
var toHighlight = $('.first').next().length > 0 ?
$('.first').next() : $('#infoWin li').first();
$(this).fadeOut(100);
$('.first').fadeOut(100);
$('.first').delay(100).removeClass('first');
toHighlight.delay(100).addClass('first');
$('.first').delay(100).fadeIn(100);
$(this).delay(100).fadeIn(100);
});
View 7 Replies
View Related
Aug 14, 2011
I'mtryingto put the right code in place to stop event bubbling on my menu script. I have a the following code for the mouseenter event. I can't find where's appropraite to put stopPropagation()
menu_trigger is an array which is cycled through to put the mouseenter event onto the right <th> tags menu_objects is an array linking to the menu which should be shown.
[Code]...
View 1 Replies
View Related
Sep 15, 2010
im having trouble using JQUERYs animate function. Basicly the div has a mouseover event that slides another div (that is inside the original div) upwards. The first div has a mouseout event that slides the second div downwards and out of view. The problem being that when you hover over the second div it fires the first divs mouseout event. Ive tried googling this and have tried adding some event bubbling but having serious trouble with it. here is the website... [URL] hover over the image and you should see the caption appear, roll over the caption and it goes crazy.
[Code]....
View 3 Replies
View Related
Sep 14, 2010
At work I have written a form builder which is all drag and drop.
The issue I have is with ending the drop, I have no problems in IE. The drag is controlled by the onmousemove and onmouseup events for the document body.
The trouble is, in Firefox, if the cursor is over a form item, then the onmouseup event doesn't fire and therefore the drag doesn't end.
There is no problem with other items, other HTML items, tables, list, divs, then all bubble the event to the body.
Anyone ever come across this, if so how did you get round it.
Do I need to manually make form elements bubble in Firefox? Maybe I should just stick a div opacity 0 over the drag objects and make that call the body's onmouseup event.
View 3 Replies
View Related
Mar 27, 2007
Wanting to have a table cell select it's contained radiobutton in a
rather non-specific way, I wrote the following javascript:
function click_it(element)
{
var x = element.childNodes
for(var i=0;i<x.length;x++)
{
var tag = x[i];
if(!tag.tagName || tag.tagName != "INPUT")
continue;
tag.checked = !tag.checked;
}}
It works fine for clicking the table cell and selecting contained
radiobuttons. However, when actually clicking the radiobutton, the
browser decides (correctly) to first fire the internal radiobutton
click event, thus selecting the radiobutton - and THEN fireing the
click handler for my table cell, thus de-selecting it again :-P If
this was to only work for radiobuttons, I could easily make it do
"tag.checked = 1" every time, but it needs to work for checkboxes too,
so the de-select should work too (if checked).
View 2 Replies
View Related
Feb 5, 2010
have a small div above (hover) a big one. I assign onmouseover and onmouseout events to the wrapper div. For image caption roll-over animation. The problem is when the mouse is above the caption itself, causing an unwanted result(probably event bubbling).
And another problem: sometimes when you move mouse from outside to container you get a a triple debug sequence: (it should be just 2): -I am over- -I am out- -I am over- (firebug console) How to make it work? (no jquery) must work on all browsers.[URL]... The wanted result: When mouse moved over the image, only mouseover event should be raised once When mouse moved out from the image, only the mouseout event should be raised. when mouse is over the captionm it should be treated as if the mouse is still on the image. (no flickering)
View 3 Replies
View Related
Oct 11, 2006
I've been implementing a drop menu in javascript, and I'm finding it difficult to understand why the event bubbling system is implemented as it is. In summary, I want an event to occur when the mouse enters/exits a large div or table that contains many descendent elements.
It appears to me, from experimenting with IE6 and Moz 5, that the event is generated *only* on the lowest element, thus given a table which contains tbody, tr and tds, with an onmouseover listener assigned to the table element (as a property), the onmouseover event is generated only for the td, although the mouse actually entered all these elements.
If there is a slight gap between elements you sometimes get events for the higher element. I guess this is a side-effect of the browser's implementation - sampling the mouse position.
My understanding of event bubbling from "JavaScript the definitive guide" is that events should bubble up the heirarchy unless they are stopped by the stopPropagation() method.
View 4 Replies
View Related
Jun 15, 2010
building a tree using UL,LI tags as below. Issue seems with cancelling event bubbling. trying to cancel dragenter event to avoid dragenter firing for root LI. dragenter on image cancels bubbling. But dragenter on the child text bubbles and fires for Root. Whole purpose is to identify LI where its dropped. Edit: Noticed this is working as expected in IE6 and not working with IE8.
[Code]...
View 1 Replies
View Related
Sep 12, 2011
I just want to understand the concept of event bubbling, capturing and delegation. I have read a lot about them but still unable to fully understand them (capturing, bubbling, delegation).
View 1 Replies
View Related
Jan 28, 2010
After spending hours trying out many different examples that supposedly work with IE and FF, I've decided to post here :)
This is the code I'm using to catch the down arrow:
function is_int(event)
{
var Key = event.keyCode ? event.keyCode : event.which ? event.which :
[Code].....
And called using the following on the text input of a form field:
onKeyDown="is_int(event);"
This works in IE but still not in Firefox (3.5.7). Surprised as it has the .which in there - I thought this is what FF needed?
View 1 Replies
View Related
Nov 21, 2011
Have been hammering away at this problem for a couple of hours and found that the 'type' attribute of the jQuery script files is set to 'application/javascript'. This works in Firefox but not IE. When changed to 'text/javascript' the IE error on $(document).ready event disappears. As yet no apparent side effects have occured. This is the only scenario where I have seen 'application/javascript' ever used so why this instead of 'text/javascript'?
View 1 Replies
View Related
Nov 7, 2011
I am trying to create some divs that hide and show when a link is clicked. There may be multiples on the same page and it each needs to functionindependently.
I've added it to jsfiddle : [URL]
When the user clicks a show more link the first time nothing happens. If you do it again the div expands as planned (great!). If you do it again to close it slides back up but then bounces straight down again (Not Great!). I can't figure out what I've done wrong!. Eventually I'm going to add more functions to show some hidden data as well.
View 4 Replies
View Related
Oct 20, 2009
My code below is working in IE but not Firefox:
[Code]...
View 5 Replies
View Related
Mar 4, 2010
Here is my code.. I am trying to wrap TBODY in DIV to have scroll for the tbody.. but it is not working as I am expected.
<!DOCTYPE html>
View 3 Replies
View Related
Apr 28, 2011
Yhe button I am using working perfecting in FireFox and Chrome but not in Internet explorer. (Yes I know someone that actually uses IE that pointed this out to me) The rest of the code works fine but just not the reset button I have. Something I have been needing to do is make the code call my images differently by putting them in an array so I don't mess this the sources of my images like I sloppily am here, but I am not sure if that will actually fix the problem I am have. The checkbox should both uncheck the box(if checked) AND change the picture but it only unchecks the box. Here is the relevant code let me know if you want me to post the whole thing.
function reset(){
cb1.checked=false;
document.goodAfternoon.src=goodAfternoonFinal.src;
}
"Check" me out;) <input type="checkbox" id="cb1" onClick="validate()" />
<img src="Good Afternoon.gif" name="goodAfternoon">
<input type="button" id="cb2" value="RESET" onClick="reset()"/>
View 4 Replies
View Related
Jun 1, 2010
I have a table that looks like:
And a function to add a row and cells in the row that looks like:
The problem is the insertCell won't insert that first cell with an x in it (which will allow users to click on the x button to delete the row) in the first cell in Google Chrome. Firefox inserts a row with the first cell containing the x button but no other cells with the text boxes.
I've tried setting the index on the cell insert to 0, 1, 8, nothing and Chrome either inserts a row with nothing in it (no text boxes, no x button, nothing other than a slight addition of space below the title row) or it adds the row correctly except the x button always winds up in the last cell. IE adds it correctly with no index value or 0. Firefox needs the 0 index (no index creates a blank row with nothing in it. It looks like there's a tiny blank row of nothing being inserted because you see the table get a tiny bit larger vertically but there is no x button, text boxes.
What am I doing wrong? How do I make this work in all 3 browsers? Well actually all browsers ideally but....
Further, if I supply the 0 index to get a row, clicking on the x button to delete it works correctly in IE and Chrome but does nothing in Firefox.
That code looks like:
So what is wrong with both the addRow and removeRow functions that is causing Chrome and Firefox to behave incorrectly?
View 5 Replies
View Related
May 26, 2010
I have a HTML page with multiple dynamic check boxes that I select, click "add" and it adds a list to the users on the next page. This is my JavaScript function that deals with this:
<script language="Javascript">
function doSelect() {
//to avoid "unidentified" results, search elements by tag name
[code]....
View 3 Replies
View Related
Nov 16, 2009
Suppose,closing the browser through Browser Close Button(Top Right Corner cross(x) button), i have to execute some ASP script , for that, in body onUnLoad Event calling a fucntion called CloseWin(e,frm), it is working in Internet Explorer successfully , But in FireFox not working. how to solve this problem. or any other way to get the co-ordinates of browser close button( code for both IE and Firefox).
code follows
function CloseWin(e,frm)
{
//frm required for my program
var bButtonClicked = false;
[Code]....
View 1 Replies
View Related
Jul 23, 2005
I am trying to implement XMLHttpRequest to a new website, but when I
include HTML, the code appears as is, instead of the formated HTML. Please
have a look and click the 1st link ("L'Association") on top (yello
horizontal bar on top): Code:
View 2 Replies
View Related
Apr 19, 2010
I'm trying to create a scroll bar through javascript with the help of jquery. What I'm trying to accomplish is:1. When the user mouse's down, it fires off an event (mouse move) and allow the user to scroll.2. When the user mouse's up, it should unbind the event, so that the mouse move is not in effect any more.But unbind is not working as expected. I looked up the documentation, and it seems correct.
Code JavaScript:
$(document).ready(function() {
$('#scrollBar').mousedown(function(e) {
[code]....
View 8 Replies
View Related
Dec 2, 2010
<html>
<head>
<script language="javascript">
var myWindow;
function christDoes(){
[Code]...
Everything is working fine except for the button created in javascript that is in the second window which is to open the third window.
View 1 Replies
View Related