jQuery this.attr on href undefined I am trying to retrieve the href attribute from a link. However, it keeps returning undefined.  This is the html, generated via ajax which I why the .on function does not work in jQuery  html += '&lt;a class="viewOffer" href="singleOffer/'+ value.id + '"&gt;View offer&lt;/a&gt;&lt;/td&gt;';   This is the jQuery function    $( ".viewOffer" ).click(function() {  alert($(this).attr('href')); });     Thanks!
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.
UI annoyances in the suggested edit review on Stack Overflow Beamer Presentation: Figure has no number? I am giving a presentation and therefore I am using the  class. I have included some figures and it works, but there is no number after "Figure".  My code:  \documentclass{beamer}  \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{listings} \usepackage{xcolor} \usepackage{eso-pic} \usepackage{mathrsfs} \usepackage{url} \usepackage{amssymb} \usepackage{amsmath} \usepackage{multirow} \usepackage{hyperref} \usepackage{booktabs} \usepackage{wallpaper} \usepackage{bbm} \usepackage{cooltooltips} \usepackage{eso-pic} \usepackage{everyshi} \usepackage{calc} \usepackage{graphicx} \usepackage{ifthen} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{animate} \usepackage[singlespacing]{setspace} \usepackage[absolute,overlay]{textpos} \usepackage{enumerate} \usepackage{hyperref} \newenvironment{changemargin}[2]{%   \begin{list}{}{%     \setlength{\topsep}{0pt}%     \setlength{\leftmargin}{#1}%     \setlength{\rightmargin}{#2}%     \setlength{\listparindent}{\parindent}%     \setlength{\itemindent}{\parindent}%     \setlength{\parsep}{\parskip}%   }%   \item[]}{\end{list}}  \setbeamercolor{frametitle}{fg=red,bg=white}  \hypersetup{pdfpagemode=FullScreen} \renewcommand*{\UrlFont}{\normalfont}  \usetheme{Goettingen} \useinnertheme{circles} \beamertemplatenavigationsymbolsempty  \setbeamerfont{page number in head/foot}{size=\large} \setbeamertemplate{footline}[frame number]   %%% \begin{document}  \frame[plain]{ \titlepage }  \setbeamertemplate{background canvas}[default]  \frame{ \frametitle{}  \begin{figure} \begin{center} \includegraphics[scale=0.2]{varweakness} \caption{VaR as a quantile} \end{center} \end{figure}  }   \end{document}   Which gives the following frame with the figure:    (I am not sure what is causing the problem, therefore I did not delete any package.)  How can I get a number, e.g. Figure 1:? Unicode Processing in C++ What is the best practice of Unicode processing in C++? How to write conditional equations with one-sided curly brackets I want to write a conditional expression such as the following.    What is the best way to express such conditional expressions in Latex? How to automatically add &raquo; (») to  elements using CSS? Discord suddenly very slow Is there a way of maintaining malleability in a homomorphic encryption system while making it infeasible to perform chosen ciphertext attacks?   I have been reading about homomorphic encryption and malleable cryptosystems lately and have found it fascinating. I still have a lot of reading to do, however, I came across a statement in my reading that suggested malleability is inherently counter to security against chosen ciphertext attacks.  While I read up more about this relationship, I am curious to learn if there a way to maintain malleability while making a chosen ciphertext attack computationally infeasible? Why or why not? Customize newform save button - Save and redirect to another form What is the best way to add redirect function into the save button on a newform in SharePoint 2013.  When the user create a list item, he/she should be redirected to another form. Is it possible to get and parse the new generated item ID?  Start - Newform URL:   End - Editform URL:   Thanks What does env x='() { :;}; command' bash do and why is it insecure? There is apparently a vulnerability (CVE-2014-6271) in bash:   I am trying to figure out what is happening, but I'm not entirely sure I understand it. How can the echo be executed as it is in single quotes?  $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test" vulnerable this is a test     EDIT 1: A patched system looks like this:  $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test" bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' this is a test   EDIT 2: There is a related vulnerability / patch:  which uses a slightly different test:  $ env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo vulnerable' bash -c "echo test"   unpatched output:  vulnerable bash: BASH_FUNC_x(): line 0: syntax error near unexpected token `)' bash: BASH_FUNC_x(): line 0: `BASH_FUNC_x() () { :;}; echo vulnerable' bash: error importing function definition for `BASH_FUNC_x' test   partially (early version) patched output:  bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' bash: error importing function definition for `BASH_FUNC_x()' test   patched output up to and including CVE-2014-7169:  bash: warning: x: ignoring function definition attempt bash: error importing function definition for `BASH_FUNC_x' test   EDIT 3: story continues with: How can I show a supremum of a set is also its limit point? It just seems like I can't wrap my head around this. For a set $A$ how can I show that the supremum of that set $\sup(A)$ is also a limit point of said set? Can I just set $$a=\sup(A)$$ $$b\le a \: \:  \forall \: b \in A$$ and then show that there's a point different from $a$ in any $\epsilon$-neighbourhood for any $\epsilon&gt;0$? Or should I use a completely different approach? How can I delete an account on a specific site? My account has 20 (!) sites associated to it.  I only use it for 3-5 sites.  To reduce clutter, I would like to delete my profiles that I do not use much.  I have went through , but when I enter the profile URL as:  http://russian.stackexchange.com/users/5772/alex   it gives the error message:     oops! this isn't a link to a valid profile   What procedure do I go through to delete my profile only on certain sites? There are several ideas on hard determinism, but the core seems to be that in an interconnected existence, there can be no "actions" (free will), but only "reactions" (determinism). An action of free will would have to be a separate entity outside of existence, so we'd say it can't occur.   Now fast forward to Joe Schmo the robbing/murdering/rapist.  Joe wasn't born in some infinite bliss utopia, then decided one day to invent the concept of scumbaggery.  He's a product of an incomprehensible number of variables - maybe some are apparent like his dad was a violent alcoholic or whatever, but most likely it's far more complicated than that.    So that's fine - I get all that - but if that's the case, then how can you ethically deal with people like that?  You can't hardly let them do what they please at the expense of society, but then how can you get medieval on them when they're basically riding a wave?  I think that's a big reason why people fight concepts of determinism that mitigate or eradicate the concept of free will - now everyone has a license to do what they want and how can you punish them, it's not their fault!  How would/could/should you consolidate hard determinism with responding to criminal acts? Why do we need autoencoders? Recently, I have been studying autoencoders. If I understood correctly, an autoencoder is a neural network where the input layer is identical to the output layer. So, the neural network tries to predict the output using the input as golden standard.  What is the usefulness of this model? What are the benefits of trying to reconstruct some output elements, making them as equal as possible to the input elements? Why should one use all this machinery to get to the same starting point? Is there any way of making a snow golem survive in hot biomes? Snow golems won't survive in the Nether (neither spawned in nor built ones). Is there a way to make a snow golem survive in the Nether and other hot biomes in vanilla Minecraft (i.e., without using mods)? Newton's cradle For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work? How to stop Gedit, Gvim, Vim, Nano from adding End-of-File newline char? How to install Tor? Do I need to explicitly call the base virtual destructor? EDIT:  My question was poorly worded.   I wasn't asking about showing $\ln(1+x) &gt; \frac{2x}{2+x}$ for $x&gt;0$.   What I wanted to know is why the lower bound provided by $ \frac{2x}{2+x}$ was so tight for small positive values of $x$. This is addressed in robjohn's answer.