How to get selected checkbox row's value using Jquery? I want to get the values of selected check box row's value using Jquery.  For that, First I try to alert a message,if user checked the checkbox using Jquery. But I failed.      Note: I am adding checkbox in a row using Jquery, and then User will select the checkbox.   Here is my code to add checkbox in row through AJAX code  $('#btnSearchVendor').click(function(){     $.ajax({         type:"POST",         contentType:"application/json;charset=utf-8",         url: "GPCreateCheque.aspx/BindData",         data:"{}",         dataType:"json",         success: function (data) {             alert("success = "+data.d[0].DOCTYPE);             for(var i=0;i&lt;data.d.length;i++){                 $("#ContentPlaceHolder1_GridView1").append("&lt;tr&gt;&lt;td&gt;&lt;input id=\"Checkbox"+i+"\" class=\"checkBoxClass\" type=\"checkbox\" /&gt;&lt;/td&gt;&lt;td&gt;" + data.d[i].DOCTYPE + "&lt;/td&gt;&lt;td&gt;" + data.d[i].DOCNUMBR + "&lt;/td&gt;&lt;td&gt;" + data.d[i].ActualAmount + "&lt;/td&gt;&lt;/tr&gt;");             }         },         error:function(result){             alert("Error");         }     }) })   Jquery code to make alert when user select the checkbox  $('.checkBoxClass').click(function () {     alert("Checkbox state (method 1) = " + $('.checkBoxClass').prop('checked'));     //alert("Checkbox state (method 2) = " + $('.checkBoxClass').is(':checked')); });   Above code is working fine, I added the checkbox. Below pic is the output with console
Event binding on dynamically created elements? I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
Expected value of sums Suppose we draw cards out of a deck without replacement. How many cards do we expect to draw out before we get an ace? If no spell can reawaken the dead, how did the resurrection stone work? Dumbledore himself said that no spell can reawaken the dead. Isn't that the main objective of the resurrection stone? If one can't reawaken the dead then what is the use of the stone? Surely then one of the Hallows is flawed? I've created a new C++ project in Visual Studio 2008.  No code has been written yet;  Only project settings have been changed.  When I compile the project, I receive the following fatal error:     fatal error LNK1104: cannot open file 'C:\Program.obj' I'm trying to process some data in Excel. The data includes numeric account numbers and other long numeric strings (like cell phone MEIDs). I am not doing math operations on these strings, so I want Excel to treat them as plain text.  Here is what is making me nuts (this is Excel 2010):   Take a long number like 1240800388917 and paste it in a cell in a new worksheet. Excel's default cell format is general, so the string is presented in scientific notation as 1.2408E+12 Right click on the cell, select Format Cells, set the format to Text   The cell is still displayed in scientific notation, even though the format has been set to text.  Now, if I do the steps in a different order:   Format an empty cell as text. Right click on the cell, select Format Cells, set the format to Text Take a long number like 1240800388917 and paste it in to the text formatted cell   Now, the cell is displayed as a string and not in scientific notation.  The results remaining in scientific notation even though the cell is formatted as text just seems broken to me. I've seen suggested work-arounds like: use CSV import and set the format to text, add a space character to the beginning of each numeric string, and others.  Is there a simple good work around to easily keep these strings formatted as text?  Why on earth does Excel do this?  Related SU questions I found:  and How can I send email attachment without using an additional library in Perl? How do I migrate my Keychain's "Local Items" to a new Mac? After preforming a Mavericks-Mavericks migration using Migration Assistant, I have a "Local Items" Keychain on my new machine in which many (perhaps most) items are out of date (using old passwords), and some are missing altogether. While I have access to a copy of the entire contents of the ~/Library/Keychains/ directory from my old machine, which presumably contains all the information I'm missing, I see no way of importing that information into my new machine.  How can I import the "Local Items" from my old Keychain into the Keychain on my new machine? in bash I have some jobs running, in background. They are always producing random irrelevant error messages that pollute the terminal. I am not always so prompt to start them with the 2&gt;&amp;1 &gt; /dev/null redirect. How can I redirect the output when they are already running? Does anyone remember a cartoon with 4-5 humanoid robots on Saturday morning in the mid-80s?  As far as I can remember, they had "powers" to zap things and maybe fly but I don't remember much of the story/plot/enemies/powers.  I don't remember humans in the show.  One scene I remember was the were on some ice world and were being chased by this huge polar kraken type monster.  They got cornered at the edge of this ice sheet and some water.  One of the robots (the leader I guess) asked if someone had any power to do anything.  They all looked at each other and one of the female robots said she did and zapped the ice sheet so they floated away from the kraken.  However, since all of them ran out of power, they couldn't do anything except stand on the ice sheet and float in the water.  I don't remember anything after this scene, probably because my parents shut off the TV, or I'm just that old.  It's also possible I caught the re-runs of it, so it's possible it's late 70s or early 80s. Deleting array elements in JavaScript - delete vs splice What is the difference between using  on the array element as opposed to using ?   For example:  myArray = ['a', 'b', 'c', 'd'];  delete myArray[1]; //  or myArray.splice (1, 1);   Why even have the splice method if I can delete array elements like I can with objects? USB flash drive not working or is appearing as an empty disk drive, Disk Management reports "No Media" with 0 bytes size I have a USB flash drive which is no longer recognized by my computer. Windows Disk Management and DiskPart report No Media with no storage space (0 bytes) on the drive and I cannot partition or format the drive:     If the drive appears in Windows Explorer, trying to access it returns an error message indicating that there is no disk inserted, such as the following:     Please insert a disk into drive X:.   Various disk partitioning and data recovery utilities don't recognize the drive or only give a generic name for the drive and cannot access the contents of the drive.  What can I do? How do I recover data from the drive?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details. I have no idea how prove that $$\{(z_0,\ldots,z_n)\in\mathbb{C}^{n+1} \quad| \quad z_0^d+z_1^2\ldots+z_n^2=0, \quad |z_0|^2+|z_1|^2\ldots+|z_n|^2=2\}$$ is a $(2n-1)$-compact manifold.  How give the charts. For $n=1$ and $d=2$ not distinguish which 1- manifdold is? I try to find a good proof for invertibility of strictly diagonally dominant matrices (defined by $|m_{ii}|&gt;\sum_{j\ne i}|m_{ij}|$).  There is a proof of this in  but I'm wondering whether there are are better proof such as using determinant, etc to show that the matrix is non singular. I have a problem. I am going to make a minecraft animation in blender. But when I put a minecraft texture on a 3d cube that is 16x16x16 it is very low resolution is there a way to get the texture in a better resolution or is there a way to make blender make the texture better?  I hope you have an answer. Thanks in advance The  recommends that images have Copy-On-Write disabled on the directory when using btfs.  I do see that it would be a good idea if you had a lot of file read/writes.   question explores this idea.  I know that VMWare will grow into different files and will write snapshots out which could be problematic when using Copy-On-Write.  For QEMU the file is left open for the VMs existance so there is a potential problem in the write after the VM is shutdown, but I would see slow I/O after a VM is shutdown not being an issue.  What pitfalls would I be avoiding by performing this step for QEMU.    Additionally: I have assumed that the image is raw for this question.  Is there a possible stability issue as qcow2 already has copy-on write. Can I have multiple primary keys in a single table? Is there a word to describe someone who tends to disagree with others only to upset them? What's the word to describe someone who acts arrogantly and always disagrees with others unreasonably in order to upset people around him/her?  [I'm not looking for adjectives like unpleasant, annoying, unfriendly, rude, I'm looking for a more specific term like opinionated, didactic, loquacious, gregarious ]  I think I'd come across it before but I've forgotten what it is.. When true polymorphed creature dies, does it revert to its original form? The  description says:     Creature into Creature.   The transformation lasts for the duration, or until the target drops to 0 hit points or dies. If you concentrate on this spell for the full duration, the transformation lasts until it is dispelled.   Does the second sentence imply the creature won't revert to its normal form, even being killed? (providing the caster were concentrating on the spell for the full duration)  If so, isn't "until the target drops to 0 hit points" enough? Why the "...or dies" addition? A creature can't die having more that 0 hit points, can it? how to stop firing oncomplete if save action has errors My requirement is to stop oncomplete call if save action has errors. I know I am doing some silly mistake.   Here I am unable to stop calling oncomplete function.  Requirement is, from VFP save method, data will get saved and then perform callout from oncomplete function. If there are any errors during save then stop making callouts.  Visualforce  &lt;apex:page id="hasErrorTestPage" controller="ErrorMessageFinder"  showHeader="false"&gt;     &lt;apex:pageMessages id="msgId"/&gt;     &lt;script&gt;         function performCallOutMethod()         {             var msg = document.getElementById('{!$Component.MSEForm.errorMsgInd}').value;             alert(msg);              if(msg == 'false' || typeof(msg) == 'undefined')             {                 alert('entering callout')                 performCallOut();                 return true;             }             else             {                 return false;             }         }     &lt;/script&gt;     &lt;apex:form id="MSEForm"&gt;         &lt;apex:actionFunction name="performCallOut" action="{!submit}" reRender="panelId,msgId"/&gt;          &lt;apex:outputPanel id="panelId"&gt;             &lt;apex:outputText value="{!hasError}" id="errorMsgInd"/&gt;         &lt;/apex:outputPanel&gt;         &lt;apex:inputText id="customerNm" value="{!CustomerName}"/&gt;&lt;br/&gt;         &lt;apex:commandButton value="Save" action="{!save}"                       oncomplete="return performCallOutMethod();" reRender="panelId,msgId"/&gt;     &lt;/apex:form&gt; &lt;/apex:page&gt;   Controller  public class ErrorMessageFinder {     public String CustomerName {get;set;}      public Boolean hasError {          get {              return ApexPages.hasMessages();          }            }      public PageReference save()     {            if(String.isBlank(CustomerName))         {             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, 'Name cannot be null');             ApexPages.addMessage(msg);             return null;         }         return null;      }       public PageReference submit()     {         try         {   //navigate to view page             PageReference pg = new PageReference('/'+ '0019000001UwnVS');             pg.setRedirect(true);             return pg;         }         catch (Exception ex)         {             System.debug('Error in submit ' + ex);             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, ex.getMessage());             ApexPages.addMessage(msg);              return null;         }     } }   Based on this code, if I hit save button without entering CustomerName then it is not showing error after save. It is showing error during oncomplete call and then navigating to view page, which I do not want.  Any help is appreciated. I have put a compiled code so that anyone can try with this code. A word with a wide range of meanings Is there a better alternative to ambiguous for a word with a wide range of meanings, difficult to find, because they become different in connection with person's opinion. I am trying to put two subscripts at the left and right of a character. For example, something like:  _{t} p_{x}  where p is in the middle. How do you do this?