Search Results

Search found 65 results on 3 pages for 'stoppropagation'.

Page 1/3 | 1 2 3  | Next Page >

  • Jquery StopPropagation not working in firefox

    - by Karim Mortabit
    I have this code working on Safari and Chrome , but not in Firefox . Is firefox having a problem with StopPropagation() ? $(function() { // Setup drop down menu $('.dropdown-toggle').dropdown(); // Fix input element click problem $('.login-menu form').click(function(e) { alert( e.isPropagationStopped() ); e.stopPropagation(); alert( e.isPropagationStopped() ); }); });

    Read the article

  • event.stopPropagation(); doesn't behave as expected

    - by Ciprian Amaritei
    I read couple articles related to event.stopPropagation(); but none of the solutions provided works for me. Basically what I have is an accordion widget with all the elements collapsed by default. On each element header (dt tag) there is also a checkbox. Clicking the checkbox shouldn't trigger the accordion to make its elements expand. <dt data-toggle="collapse"> <span class="subscribe-checkbox"><button type="button" class="btn toggle-btn" data-toggle="button"></button></span> </dt> <dd> <p>Accordion content...</p> </dd> Clicking the span (which should act as a checkbox ) should add class "checked" to it. However it also expands the accordion element (dd tag). What I'm doing in jQuery is: $('.accordion-group .btn.toggle-btn').click(function (event) { event.stopPropagation(); }); While the accordion content isn't shown ( which is good) the element doesn't change class either, so it doesn't become 'checked'. I tried with .live() too and didn't work either. Thanks in advance, Ciprian.

    Read the article

  • Capturing clicks even when stopPropagation has been called (ie by 3rd party code)?

    - by josh
    I want to detect any click that happens on a page (to close a custom context menu). I'm using jQuery and trying to do $(document).click(function(){ ...close my context menu ... }); However, I'm using some code that calls evt.stopPropagation() in the click handlers for certain elements on the page, and those clicks aren't making it up to my top-level handler. Is there any way of capturing those clicks? Can be jQuery or not jQuery, as long as it works cross-browser.

    Read the article

  • jQuery event.stopPropagation is not working on <a>

    - by HorusKol
    I have the following javascript: $('#ge-display').click(function (event) { window.open('/googleearth/ge-display.php','','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=no,status=no'); event.stopPropagation(); return false; }); the element with id 'ge-display' is a standard link: <a href="/googleearth/ge-display.php" id="ge-display" target="_blank">Load Google Earth Plugin (in a new window)</a> The problem is - when I take out the 'return false;' line from the click event handler, the javascript popup opens, and then another browser window opens - I thought stopPropagation() would prevent the links own click handler? I've also tried stopImmediatePropagation() - but I still need to return false to stop the default behaviour of the link.

    Read the article

  • jQuery stopPropagation bubble down

    - by Jasie
    I have a div with a link inside of it: <div id="myDiv"> <a href="http://www.lol.com">Lol</a> </div> Clicking the <div /> should go somewhere, but clicking the child <a /> should go to www.lol.com. I've seen from previous questions and the jQuery website that .stopPropagation prevents bubbling upwards, but how do I prevent a bubble downwards (isn't that what's necessary here?).

    Read the article

  • jQuery live() and stopPropagation() issue

    - by colourandcode
    I know that the live() event handles event bubbling different than all other jQuery events. jQuery recommends using 'return false', but in my case that doesn't work. The issue is: I have a DIV which contains an anchor tag. The DIV is bound using live(). Whenever I click the anchor tag inside this DIV it bubbles and calls the DIV's event. If I bind an event to that A tag which returns false it prevents the link from opening. Neither stopPropagation() or return false work in this case. Are there any other options? Ideally I'd like to keep the live() event around.

    Read the article

  • jQuery e.stopPropagation() - how to use without breaking dropbox functionality altogether?

    - by Knut Ole
    Short story: stopPropagation() prevents a dropdown menu from closing - which is good. But it also prevents the dropbox from opening next time around - which is bad. Long story: I'm using Twitter-Bootstrap and I've put a search box inside the dropdown menu like so: <div id="search_word_menu" style="position:absolute;right:157px;top:60px;"> <ul class="nav nav-pills"> <li class="dropdown" id="menu200"> <a class="dropdown-toggle btn-inverse" data-toggle="dropdown" style="width:117px;position:relative;left:2px" href="#menu200"> <i class="icon-th-list icon-white"></i> Testing <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="#">Retweets</a></li> <li><a href="#">Favourites</a></li> <li class="divider"></li> <li><a href="#">A list</a></li> <li class="divider"></li> <li><a href="#">A saved search</a></li> <li><a href="#">A saved #hashtag</a></li> <li class="divider"></li> <li> <!-- HERE --> <input id="drop_search" type="text" class="search_box_in_menu" value="Search..."> </li> </ul> </li> </ul> When I click inside the searchbox, the default behaviour is obviously to close the dropdown - but that makes it rather hard to write in a search term. So I've tried with the e.stopPropagation(), which does indeed prevent the dropdown from closing. Then, when I press enter in the searchbox, I'm closing the dropdown with a .toggle() - also seems to work fine. The PROBLEM arises when I want to to it all again, because the e.stopPropagation() has now disabled the dropdown alltogether - ie. when I press the dropdown menu, it doesn't open anymore! This is because of stopPropagation(), no doubt - but how can I resolve this, so that I get the aforementioned functionality, but without breaking the rest altogether? jQuery below: $(document).ready(function() { console.log("document.ready - "); //clearing search box on click $(".search_box_in_menu").click(function(e) { e.stopPropagation(); // works for the specific task console.log(".search_box_in_menu - click."); if($(this).val() == 'Search...') { $(this).val(''); console.log(".search_box_in_menu - value removed."); }; //return false; //this is e.preventDefault() and e.stopPropagation() }); // when pressing enter key in search box $('.search_box_in_menu').keypress(function(e) { var keycode = (e.keyCode ? e.keyCode : e.which); if(keycode == '13') { console.log(".search_box_in_menu - enter-key pressed."); console.log($(this).val()); $(this).closest('.dropdown-menu').toggle(); //works } }); $('.dropdown').click(function() { console.log(".dropdown - click."); $(this).closest('.dropdown-toggle').toggle(); //does nothing }); Would greatly appreciate some help! I'm starting to suspect this might be a bootstrapped-only problem, or at least caused by their implementation - but it's beyond me atm.

    Read the article

  • Calling AddEventListener in a loop with a variable element name

    - by user302209
    Hi, I'm trying to do the following: I have a set of images and select (dropdown) HTML elements, 30 of each one. I'm trying to use AddEventListener on a loop from 1 to 30 so that when I change the value of the select, the image src is updated (and the image changes). The AddEventListener function is this one: function AddEventListener(element, eventType, handler, capture) { if (element.addEventListener) element.addEventListener(eventType, handler, capture); else if (element.attachEvent) element.attachEvent("on" + eventType, handler); } I tried this and it worked: var urlfolderanimalimages = "http://localhost/animalimages/"; var testselect = "sel15"; var testimg = "i15"; AddEventListener(document.getElementById(testselect), "change", function(e) { document.getElementById(testimg).src = urlfolderanimalimages + document.getElementById(testselect).value; document.getElementById(testimg).style.display = 'inline'; if (e.preventDefault) e.preventDefault(); else e.returnResult = false; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; }, false); But then I tried to call it in a loop and it doesn't work. The event is added, but when I change any select, it will update the last one (the image with id i30). var urlfolderanimalimages = "http://localhost/animalimages/"; for (k=1;k<=30;k++) { var idselect = "sel" + k; var idimage = "i" + k; AddEventListener(document.getElementById(idselect), "change", function(e) { document.getElementById(idimage).src = urlfolderanimalimages + document.getElementById(idselect).value; document.getElementById(idimage).style.display = 'inline'; if (e.preventDefault) e.preventDefault(); else e.returnResult = false; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; }, false); } What am I doing wrong? I'm new to JavaScript (and programming in general), so sorry for the vomit-inducing code :(

    Read the article

  • Jquery click event assignment not working in Firefox

    - by Mantorok
    Hi all I'm assigning a click event to a bunch of anchors by class name, and it works in all browsers except Firefox, here is the JS: var click_addthis = function(e, href) { if (!e) { var e = window.event; } e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); window.open(href, "Share It", null); return false; } $(document).ready(function() { $(".addthis_button_facebook").click(function() { click_addthis(event, this.href) }); $(".addthis_button_twitter").click(function() { click_addthis(event, this.href) }); }); Am I missing something? Thanks

    Read the article

  • AJAX jQuery click results in function event being fired twice

    - by pmagunia
    I have an AJAX chat room module in Drupal and I am trying to insert BBCode stlye tex tags to the submit box when the user clicks Insert Tex. I managed to get the following code to work the first time but afterwards when I click Insert Tex it inserts the tex tags triple times. $('#edit-chatroom-message-entry-submit').click(function (e) { e.preventDefault(); e.stopPropagation(); if ($('#edit-chatroom-message-entry-box').val()){ Drupal.chatroom.postMessage($('#edit-chatroom-message-entry-box').val()); $('#edit-chatroom-message-entry-box').val('').focus(); } }); $('#edit-chatroom-tex-submit').click(function (e) { e.preventDefault(); e.stopPropagation(); $('#edit-chatroom-message-entry-box').val($('#edit-chatroom-message-entry-box').val() + '[tex][/tex]'); }); I would appreciate it if a suggestion could be make to make the code work properly.

    Read the article

  • html5 uploader + jquery drag & drop: how to store file data with FormData?

    - by lauthiamkok
    I am making a html5 drag and drop uploader with jquery, below is my code so far, the problem is that I get an empty array without any data. Is this line incorrect to store the file data - fd.append('file', $thisfile);? $('#div').on( 'dragover', function(e) { e.preventDefault(); e.stopPropagation(); } ); $('#div').on( 'dragenter', function(e) { e.preventDefault(); e.stopPropagation(); } ); $('#div').on( 'drop', function(e){ if(e.originalEvent.dataTransfer){ if(e.originalEvent.dataTransfer.files.length) { e.preventDefault(); e.stopPropagation(); // The file list. var fileList = e.originalEvent.dataTransfer.files; //console.log(fileList); // Loop the ajax post. for (var i = 0; i < fileList.length; i++) { var $thisfile = fileList[i]; console.log($thisfile); // HTML5 form data object. var fd = new FormData(); //console.log(fd); fd.append('file', $thisfile); /* var file = {name: fileList[i].name, type: fileList[i].type, size:fileList[i].size}; $.each(file, function(key, value) { fd.append('file['+key+']', value); }) */ $.ajax({ url: "upload.php", type: "POST", data: fd, processData: false, contentType: false, success: function(response) { // .. do something }, error: function(jqXHR, textStatus, errorMessage) { console.log(errorMessage); // Optional } }); } /*UPLOAD FILES HERE*/ upload(e.originalEvent.dataTransfer.files); } } } ); function upload(files){ console.log('Upload '+files.length+' File(s).'); }; then if I use another method is that to make the file data into an array inside the jquery code, var file = {name: fileList[i].name, type: fileList[i].type, size:fileList[i].size}; $.each(file, function(key, value) { fd.append('file['+key+']', value); }); but where is the tmp_name data inside e.originalEvent.dataTransfer.files[i]? php, print_r($_POST); $uploaddir = './uploads/'; $file = $uploaddir . basename($_POST['file']['name']); if (move_uploaded_file($_POST['file']['tmp_name'], $file)) { echo "success"; } else { echo "error"; } as you can see that tmp_name is needed to upload the file via php... html, <div id="div">Drop here</div>

    Read the article

  • jQuery: add border on hovered element but NOT parents

    - by John Isaacks
    I have this code: var originalBorder = container.css("border"); container.hover(function(event) { event.stopPropagation(); $(this).css("border", "1px solid "+options.color); },function(){ $(this).css("border", originalBorder); }); Which I am using to add a border to the currently hovered element. However for example if a span is inside a div they are both getting borders. I only want to target the span. I thought that adding event.stopPropagation() would do the trick (this is what I would do in Flex, which is what I am more used to) but I guess this is a live event which I dont even understand what that means. So basically how can target the youngest element without triggering the parents? Thanks!!

    Read the article

  • Why jquery have problem with onbeforeprint even?

    - by Cesar Lopez
    Hi all, I have the following function. $(function() { $(".sectionHeader:gt(0)").click(function() { $(this).next(".fieldset").slideToggle("fast"); }); $("img[alt='minimize']").click(function(e) { $(this).closest("table").next(".fieldset").slideUp("fast"); e.stopPropagation(); return false; }); $("img[alt='maximize']").click(function(e) { $(this).closest("table").next(".fieldset").slideDown("fast"); e.stopPropagation(); return false; }); }); <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading 1</td></tr></table> <div style="display:none;" class="fieldset">Content 1</div> <table class="sectionHeader" ><tr ><td>Heading 2</td></tr></table> <div style="display:none;" class="fieldset">Content 2</div> I have several div class="fieldset" over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. I would appreciate if anyone comes with a solution for this. Anyone have any idea why is this or how to fix it? Thanks. PS:Using a does not work either ( I assume because jquery using toggle) and its not the kind of question I am looking for.

    Read the article

  • AJAX Submit to PHP still loading page after preventDefault()

    - by dannyburrows
    I have a webpage that I am using .ajax to send variables to a php script. The php page is loading into the browser as if I was navigating to it. The script is loading the data correctly, so my issue is stopping the navigation and keeping the user on the original page. The code for my form is here: echo "<form method='post' action='addTask.php' id='myform'>\n"; echo "<input name='addtask' id='addtask' maxlength='64'/><br/>\n"; echo "<input type='submit' name='submit' id='submit' value='Add Task'/>\n"; echo "</form>\n"; The code for my jquery is here: $(function(){ $('#myform').submit(function(e){ e.stopPropagation(); $.ajax({ url: 'addTask.php', type: 'POST', data: {}, success: alert("Success") }); }); }); I have tried: e.preventDefault(), e.stopPropagation() and return false. Any help is appreciated. $("#submit").click(function(e){ e.preventDefault(); $.ajax({ type: "POST", url: "addtask.php", data: { } }) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }); and $(function(){ $('#myform').submit(function(e){ e.preventDefault(); $.ajax({ url: 'addTask.php', type: 'POST', data: {}, success: function(){alert("Success")} }); }); });

    Read the article

  • stop background of iphone webapp from responding to swipes

    - by JoeS
    I'm making a mobile version of my website, and trying to make it feel as native as possible on the iphone. However, any background areas of the page respond to swiping gestures such that you can shift the page partway off the screen. Specifically, if the user touches and swipes left, for example, the content shifts off the edge of the screen and one can see a gray background 'behind' the page. How can this be prevented? I'd like to have the page itself be 320x480 with scroll-swiping disabled (except on list elements that I choose). I have added the following meta tags to the top of the page: <meta name="viewport" content="width=320; height=480; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> I've also tried the following as the event handler for the touchstart, touchmove, and touchend events of the body element: function cancelTouchEvent(e) { if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); return false; } It doesn't stop the swiping behavior, but does prevent clicks on all links on the page... Any help is much appreciated. Thanks!

    Read the article

  • Why jquery have problem with onbeforeprint event?

    - by Cesar Lopez
    Hi all, I have the following function. $(function() { $(".sectionHeader:gt(0)").click(function() { $(this).next(".fieldset").slideToggle("fast"); }); $("img[alt='minimize']").click(function(e) { $(this).closest("table").next(".fieldset").slideUp("fast"); e.stopPropagation(); return false; }); $("img[alt='maximize']").click(function(e) { $(this).closest("table").next(".fieldset").slideDown("fast"); e.stopPropagation(); return false; }); }); <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading 1</td></tr></table> <div style="display:none;" class="fieldset">Content 1</div> <table class="sectionHeader" ><tr ><td>Heading 2</td></tr></table> <div style="display:none;" class="fieldset">Content 2</div> I have several div class="fieldset" over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. I would appreciate if anyone comes with a solution for this. Anyone have any idea why is this or how to fix it? Thanks. PS:Using a does not work either ( I assume because jquery using toggle) and its not the kind of question I am looking for.

    Read the article

  • How to stop event bubbling with jquery live?

    - by chobo2
    Hi I am trying to stop some events but stopPropagation does not work with "live" so I am not sure what to do. I found this on their site. Live events do not bubble in the traditional manner and cannot be stopped using stopPropagation or stopImmediatePropagation. For example, take the case of two click events - one bound to "li" and another "li a". Should a click occur on the inner anchor BOTH events will be triggered. This is because when a $("li").bind("click", fn); is bound you're actually saying "Whenever a click event occurs on an LI element - or inside an LI element - trigger this click event." To stop further processing for a live event, fn must return false It says that fn must return false so what I tried to do $('.MoreAppointments').live('click', function(e) { alert("Hi"); return false; }); but that did not work so I am not sure how to make it return false. Update Here is some more information. I have a table cell and I bind a click event to it. $('#CalendarBody .DateBox').click(function(e) { AddApointment(this); }); So the AddApointment just makes some ui dialog box. Now the live code(MoreAppointments) sits in this table cell and is basically an anchor tag. So when I click on the anchor tag it first goes to the above code(addApointment - so runs that event first) runs that but does not launch my dialog box instead it goes straight to the (MoreAppointment) event and runs that code. Once that code has run it launches the dialog box from "addApointment". Update 2 Here is some of the html. I did not copy the whole table since it is kinda big and all the cells repeat itself with the same data. If needed I will post it. <td id="c_12012009" class="DateBox"> <div class="DateLabel"> 1</div> <div class="appointmentContainer"> <a class="appointments">Fkafkafk fakfka kf414<br /> </a><a class="appointments">Fkafkafk fakfka kf414<br /> </a><a class="appointments">Fkafkafk fakfka kf414<br /> </a><a class="appointments">Fkafkafk fakfka kf414<br /> </a><a class="appointments">Fkafkafk fakfka kf414<br /> </a> </div> <div class="appointmentOverflowContainer"> <div> <a class="MoreAppointments">+1 More</a></div> </div> </td>

    Read the article

  • Is there way to extend jQuery to handle a custom enter key event?

    - by Ken
    I write the following code all the time to handle when the enter key pressed: $("#selectorid").keypress(function (e) { if (e.keyCode == 13) { var targetType = e.originalTarget ? e.originalTarget.type.toLowerCase() : e.srcElement.tagName.toLowerCase(); if (targetType != "textarea") { e.preventDefault(); e.stopPropagation(); // code to handler enter key pressed } } }); Is there a way to extend jQuery so that I could just write: $("#selectorid").enterKeyPress(fn);

    Read the article

  • How to re-enable the context menu in this case?

    - by lemonedo
    document.addEventListener('contextmenu', function (e) { e.preventDefault() e.stopPropagation() e.returnValue = false e.cancleBubble = true }) No way? Edit: document.oncontextmenu = null does not work. P.S. I cannot have the reference of the listener function since I am not the owner of the site preventing the context menu.

    Read the article

  • disable Opera function key in javascript

    - by DonDon
    I'm writing javascript code for a web emulator containing function keys. The user is able to press keyboard function keys to process something in the emulator, I used stopPropagation and preventDefault javascript function to stop/cancel browsers invoking their function key shortcut (e.g. F1 will invoke Firefox to open its help page) and the code works fine under Firefox and Chrome. But Opera didn't work. I'm using latest Opera 10.5 here. Can anyone help ?

    Read the article

  • How to check if the tab page is dirty and prompt the user to save before navigating away using ajaxtoolkit tab control in ASP.NET

    Step 1: Put a hidden variable in Update panel <asp:HiddenField ID="hfIsDirty" runat="server" Value="0" /> Step 2: Put the following code in ajaxcontrol tool kit tabcontainer OnClientActiveTabChanged="ActiveTabChanged" Copy the following script in the aspx page. <script type="text/javascript">       //Trigger Server side post back for the Tab container       function ActiveTabChanged(sender, e) {           __doPostBack('<%= tcBaseline.ClientID %>', '');       }       //Sets the dirty flag if the page is dirty       function setDirty() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           if (hf != null)               hf.value = 1;       }       //Resets the dirty flag after save       function clearDirty() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           hf.value = 0;       }       function showMessage() { return "page is dirty" }       function setControlChange() {           if (typeof (event.srcElement) != 'undefined')           { event.srcElement.onchange = setDirty; }       }       function checkDirty() {           var tc = document.getElementById("<%=tcBaseline.ClientID%>");           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           if (hf.value == "1") {               var conf = confirm("Do you want o loose unsaved changes? Please Cancel to stay on page or OK to continue ");               if (conf) {                   clearDirty();                   return true;               }               else {                   var e = window.event;                   e.cancelBubble = true;                   if (e.stopPropagation) e.stopPropagation();                   return false;               }           }           else               return true;       }       document.body.onclick = setControlChange;       document.body.onkeyup = setControlChange;       var onBeforeUnloadFired = false;       // Function to reset the above flag.       function resetOnBeforeUnloadFired() {           onBeforeUnloadFired = false;       }       function doBeforeUnload() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           // If this function has not been run before...           if (!onBeforeUnloadFired) {               // Prevent this function from being run twice in succession.               onBeforeUnloadFired = true;               // If the form is dirty...               if (hf.value == "1") {                   event.returnValue = "If you continue you will lose any changes that you have made to this record.";               }           }           window.setTimeout("resetOnBeforeUnloadFired()", 1000);       }       if (window.body) {           window.body.onbeforeunload = doBeforeUnload;       }       else           window.onbeforeunload = doBeforeUnload;   </script> Step 3: Here is how the tabcontrol should look like <asp:UpdatePanel ID="upTab" runat="server" UpdateMode="conditional">                     <ContentTemplate>                         <ajaxtoolkit:TabContainer ID="tcBaseline" runat="server" Height="400px" OnClientActiveTabChanged="ActiveTabChanged">                             <ajaxtoolkit:TabPanel ID="tpPersonalInformation" runat="server">                                 <HeaderTemplate>                                     <asp:Label ID="lblPITab" runat="server" Text="<%$ Resources:Resources, Baseline_Tab_PersonalInformation %>"                                         onclick="checkDirty();"></asp:Label>                                 </HeaderTemplate>                                 <ContentTemplate>                                     <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </ContentTemplate>                             </ajaxtoolkit:TabPanel> span.fullpost {display:none;}

    Read the article

  • How to check if the tab page is dirty and prompt the user to save before navigating away using ajaxtoolkit tab control in ASP.NET

    Step 1: Put a hidden variable in Update panel <asp:HiddenField ID="hfIsDirty" runat="server" Value="0" /> Step 2: Put the following code in ajaxcontrol tool kit tabcontainer OnClientActiveTabChanged="ActiveTabChanged" Copy the following script in the aspx page. <script type="text/javascript">       //Trigger Server side post back for the Tab container       function ActiveTabChanged(sender, e) {           __doPostBack('<%= tcBaseline.ClientID %>', '');       }       //Sets the dirty flag if the page is dirty       function setDirty() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           if (hf != null)               hf.value = 1;       }       //Resets the dirty flag after save       function clearDirty() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           hf.value = 0;       }       function showMessage() { return "page is dirty" }       function setControlChange() {           if (typeof (event.srcElement) != 'undefined')           { event.srcElement.onchange = setDirty; }       }       function checkDirty() {           var tc = document.getElementById("<%=tcBaseline.ClientID%>");           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           if (hf.value == "1") {               var conf = confirm("Do you want o loose unsaved changes? Please Cancel to stay on page or OK to continue ");               if (conf) {                   clearDirty();                   return true;               }               else {                   var e = window.event;                   e.cancelBubble = true;                   if (e.stopPropagation) e.stopPropagation();                   return false;               }           }           else               return true;       }       document.body.onclick = setControlChange;       document.body.onkeyup = setControlChange;       var onBeforeUnloadFired = false;       // Function to reset the above flag.       function resetOnBeforeUnloadFired() {           onBeforeUnloadFired = false;       }       function doBeforeUnload() {           var hf = document.getElementById("<%=hfIsDirty.ClientID%>");           // If this function has not been run before...           if (!onBeforeUnloadFired) {               // Prevent this function from being run twice in succession.               onBeforeUnloadFired = true;               // If the form is dirty...               if (hf.value == "1") {                   event.returnValue = "If you continue you will lose any changes that you have made to this record.";               }           }           window.setTimeout("resetOnBeforeUnloadFired()", 1000);       }       if (window.body) {           window.body.onbeforeunload = doBeforeUnload;       }       else           window.onbeforeunload = doBeforeUnload;   </script> Step 3: Here is how the tabcontrol should look like <asp:UpdatePanel ID="upTab" runat="server" UpdateMode="conditional">                     <ContentTemplate>                         <ajaxtoolkit:TabContainer ID="tcBaseline" runat="server" Height="400px" OnClientActiveTabChanged="ActiveTabChanged">                             <ajaxtoolkit:TabPanel ID="tpPersonalInformation" runat="server">                                 <HeaderTemplate>                                     <asp:Label ID="lblPITab" runat="server" Text="<%$ Resources:Resources, Baseline_Tab_PersonalInformation %>"                                         onclick="checkDirty();"></asp:Label>                                 </HeaderTemplate>                                 <ContentTemplate>                                     <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </ContentTemplate>                             </ajaxtoolkit:TabPanel> span.fullpost {display:none;}

    Read the article

  • Another Internet Explorer problem... JQuery events

    - by Parhs
    Here is my spaggeti code $("#table_exams tbody tr").click(function () { window.location.hash="#" +$(this).attr("exam_ID"); window.location.href="/medilab/prototypes/exams/edit?examId=" + $(this).attr("exam_ID") +"&referer=" + referer; row_select(this); }); $("#table_exams tbody tr td a").click(function () { window.location.hash="#" +$(this).parent().parent().attr("exam_ID"); var where="/medilab/prototypes/exams/edit?examId=" + $(this).parent().parent().attr("exam_ID") +"&referer=" + referer; window.open(where); row_select($(this).parent().parent()); alert("propaganda"); event.stopPropagation(); event.preventDefault(); return false; }); The problem is that when this function is triggered $("#table_exams tbody tr td a").click(function () { the other function is triggered also.... only in IE... What can i do for this????

    Read the article

1 2 3  | Next Page >