When the IFrame loads this code attaches 'click' event to 'a' tag.              function AddEventListenerToFrame(iframe)              {                 var frame = $(iframe).get(0).contentDocument;                 $('a', frame).click(function (event) {                     $(this).attr("target", "_blank");                 });             }   This works fine. But when the user clicks on the rendered menu and new partial is rendered, the clicks does not work anymore.  So, the issue is : event does not work on the new elements.  How to attach the same event for new rendered content ??
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.
Manually clear saved question drafts I've seen lately that new question editing is stored somewhere for later use if we wander off the new question without posting it and then return back to the page. Which is a good functionality addition in it's own right.  What I'd like to also have is the Discard this draft functionality that would clear form data and forget it. Somehow we find an answer in the meantime and the question isn't valid any more.  So having a Discard saved draft or something similar would be a nice contra-functionality to auto-save to remove stored data. The way it's implemented now seems too hidden hidden and unpredictable to users.  Additional edit  When adding hidden auto functionality usually means creating the opposite as well by either giving the possibility to preference of not having automatism at all or giving the possibility to clear what's been auto saved.  Let's see how GMail doesn't work (and I think we all agree that from UX perspective it does the job as expected:   User clicks Compose message User starts writing a new email message User decides to not send the message and checks their inbox User clicks Compose message again A clean form is presented to user (old one being part of drafts)   I'm not suggesting we should have something like Saved drafts but we surely should have the possibility to clear previous question draft.  Since this new functionality was introduced I should point out that I would use the discard functionality more frequently than the saved one. I do welcome saving messages, but discarding of saved drafts is anything but a rare situation one might want to do. It wouldn't be a problem if this was a 1% against 99%. To me it's more like 50/50.  Best possible solution  When providing saved drafts there should (from the UX perspective) be the opposite functionality as well. Namely discarding of it. But first thing we should be asking ourselves is:    do users more frequently need pre-filled saved question draft or do users more frequently need empty form with the possibility to populate it with a saved draft   User testing should provide the usage frequency between the two and the one that's more likely to happen (my guess is that there would be a big difference between the two) should be implemented. So one of these:   Pre-populate question fields with saved draft on question form load, while also providing a button to clear the draft and start writing anew without the need to manually clear all the fields (which would be the optimal solution in case of a single field form) Question form should always load empty while also having a button that would pre-populate it with a saved draft.   I think this would be the best consensus related to saved question drafts and their usage. But as we've seen this issue has been swept under the rug for an indefinite time. How to define a bijection between $(0,1)$ and $(0,1]$? How to define a bijection between $(0,1)$ and $(0,1]$?   Or any other open and closed intervals?   If the intervals are both open like $(-1,2)\text{ and }(-5,4)$ I do a cheap trick (don't know if that's how you're supposed to do it): I make a function $f : (-1, 2)\rightarrow (-5, 4)$ of the form $f(x)=mx+b$ by \begin{align*} -5 = f(-1) &amp;= m(-1)+b \\ 4 = f(2) &amp;= m(2) + b \end{align*} Solving for $m$ and $b$ I find $m=3\text{ and }b=-2$ so then $f(x)=3x-2.$  Then I show that $f$ is a bijection by showing that it is injective and surjective. Do immigration checks exist between Northern Ireland and England/Scotland? (not just for flights but also ferry/bus/train) Do immigration checks exist between the Republic of Ireland and England/Scotland? In a multiple linear regression, why is it possible to have a highly significant F statistic (p&lt;.001) but have very high p-values on all the regressor's t tests?  In my model, there are 10 regressors. One has a p-value of 0.1 and the rest are above 0.9    For dealing with this problem see the . How to write below bullet I have to write something under the symbol \bullet in Latex. Is it possible? I'm using the class beamer. Here it is an example of a frame:  \begin{frame} \begin{itemize} \item&lt;1-&gt; Products Market\mbox{}\\ \footnotesize{where $p_{i,t}=u_{i,t}$, with $u_{i,t}\sim u[0,2]$} \vspace{0.5cm} \item&lt;2-&gt; Credit Market \mbox{} \vspace{0.2cm} \\ \footnotesize{where \hspace{0.1cm} $\bullet_{bank} \xrightarrow{loan} \bullet$} \vspace{0.5cm} \item&lt;3-&gt; Interbank Market\mbox{} \vspace{0.08cm} \\ \footnotesize{where \hspace{0.1cm} $\bullet \xrightarrow{loan} \bullet$} \end{itemize} \end{frame}   In particular I want to write "bank" under the bullet, while now it is only in subscript.  Thanks Change citation conjunction from "and" to "i" How can I change the citation conjunction from english "and" to catalan "i"?  Otherwise  Author = {Kirk, D. and MacPhail, A.},   would get cited as (Kirk and MacPhail, 2002) when it should be (Kirk i MacPhail, 2002).  When there are more than 2 authors I get et al. which is fine.  I've seen  and  which do not work with apalike style.  Also, I'd rather not use biblatex if possible. How to use hook_node_presave to change field's value Basically, I want to put first name &amp; surname together into $node->field_par_contact_name  But it gives me warning. (See below)   function partnership_node_presave($node) {   if($node->type == 'partnership') {     $first_name = $node->field_par_contact_first_name['und'][0]['name'];     $surname = $node->field_par_contact_surname['und'][0]['name'];      // https://drupal.org/project/field_hidden     // Hidden variable     $node->field_par_contact_name['und'][0]['value'] = $first_name. ' '. $surname;      // Warning after save: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of .../drupal-7.23/includes/entity.inc   } }   Updated, please see image: By definition $\aleph_1 = 2 ^{\aleph_0}$. And since $2 &lt; \aleph_0$, then $2^{\aleph_0} = {\aleph_1} \le \aleph_0 ^ {\aleph_0}$. However, I do not know what exactly $\aleph_0 ^ {\aleph_0}$ is or how I could compute it. How to add a node in the middle of the line with tikz? A TV show, from the 90's or 80's, very weird Does anyone remember a show, where:   An alien girl lives with a family She comes from the moon She is looking for a new king because their king (a giant baby) is dying Her spaceship its a VW van They had a doorframe, yes a doorframe, that could open to other alternative universes or dimentions In my document, I will write something like this (using natbib, but that shouldn't matter too much):  \citet{reference} show that .....   which would render as     Jones et al (1990) show that....   (\citet in \natbib creates an 'author-list (year)' reference style)  Of course if {reference} was a single individual, I should have written  \cite{reference} shows that ....   rendering as     Jones (1990) shows that....   Since I'm lazy and can't take the extra 5 seconds to search the reference to see if it's a single author or not, is there conceivably an automated way to do pluralization ? Or some relatively simple macro that would look like   \IfRefIsPlural{reference}{show}{shows} I'm trying to generate a secret key to be used for HMAC SHA-256 signature processing. I've seen many sample of keys with variable length from 32 characters to 96 characters.  What is the ironclad rule for this key size? I want to add this iostat command to my .bashrc and create an alias for it: iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')  I'm adding this to my .bashrc: alias ios='iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')'  Unfortunately, it doesn't work. If I run the above iostat command in a terminal it works, but when I run the ios alias it no longer works. And yes, I restart my shell every time. How do I access the index in a for loop like the following?  ints = [8, 23, 45, 12, 78] for i in ints:     print('item #{} = {}'.format(???, i))   I want to get this output:  item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78   When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case? $SU(3)$ irreducible representations with tensor method If I buy a game from PSN on ps3 Is it permanently mine? I have this struct:  struct Map {     public int Size;      public Map ( int size )     {         this.Size = size;     }      public override string ToString ( )     {         return String.Format ( "Size: {0}", this.Size );     } }   When using array, it works:  Map [ ] arr = new Map [ 4 ] {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  arr [ 2 ].Size = 0;   But when using List, it doesn't compile:  List&lt;Map&gt; list = new List&lt;Map&gt; ( ) {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  list [ 2 ].Size = 0;   Why? C++ iostream Corruption using stringstream I have a very stupid question. I developed a website that has only one page at the public html directory(index.php).  all content are dynamically loaded as different pages.   How can i SEO my pages for google?  i mean like the what we type in this site are .............i believe stored in database and search engine find these pages like any static pages...  Just a little tip would be appreciable.......! When two phrases are pronounced alike but have different spelling and meaning, can we call them homophones?  e.g. "ice-cream" and "I scream", "nitrate" and "night rate", "that's tough" and "that stuff".  Or is there another term for them?  What linguistic phenomenon distiguishes these near homophones?  I've checked the putative duplicate at  but it isn't exactly what I'm asking here.