My code doesn't show errors, but also doesn't work as it should. The output from the ajax call is working fine but I just can't get anything out of the onClick, no errors message, nothing.  The HTML  &lt;div id="serials"&gt;&lt;/div&gt; &lt;div id="accounts_info_key" style="text-align:left"&gt;&lt;/div&gt;   The Ajax call  $(document).ready(function() {  $('.tab2').click(function(){         var account_id = $('#account_id').val();               $.ajax({                  url: 'ajax/account_info_serials_ajax.php',                  type:'POST',                  dataType: 'json',                  data: 'account_id='+account_id,                         success: function(response){                 $('#serials').html(response.table),                 $('#accounts_info_key').html(response.key),                 $('.drop_down').hide();                 },               error:function (xhr, ajaxOptions, thrownError){               alert(thrownError);                } // End of success function of ajax form               }); //end of ajax        });//close trigger   });//close whole function   The PHP     $response = '';    $response .='&lt;div class="question"&gt;';    $response .='plop';     $response .='&lt;/div&gt;';    $response .='&lt;div class="drop_down"&gt;';    $response .='bob';    $response .='&lt;/div&gt;';     $output_array = array(               'table' =&gt; $response,               'key' =&gt; $key,               'count' =&gt; $count      );    echo json_encode($output_array);   The jquery onclick  $(document).ready(function() {       $('#serials').on("click", ".question", function(e){         alert('smeg');       }); });   Please note, I am not asking how to do it, I am asking why my version is not working, it is NOT a duplicate question
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.
Undergraduate classical mechanics introduces both Lagrangians and Hamiltonians, while undergrad quantum mechanics seems to only use the Hamiltonian. But particle physics, and more generally quantum field theory seem to only use the Lagrangian, e.g. you hear about the Klein-Gordon Lagrangian, Dirac Lagrangian, Standard Model Lagrangian and so on. Why is there a mismatch here? Why does it seem like only Hamiltonians are used in undergraduate quantum mechanics, but only Lagrangians are used in quantum field theory? Let $f$ be a continuous and open map from $\mathbb R $ to $\mathbb R$.Prove that $f$ is monotonic. Let $f$ be  a continuous and open map from $\mathbb R $ to $\mathbb R$.Prove that $f$ is monotonic.  Suppose that $f$ is not monotonic.Then $\exists a,b;a&gt;b$ such that $f(a)&lt;f(b)$ and $c,d;c&lt;d$ such that $f(c)&gt;f(d)$.Since $f$ is continuous then there exists no break in the graph of $f$. But how should I use the fact that $f$ is open.Any help on how should I do the proof? Can't paste data to question, get prompted for Image? How do I configure internet connection for Terminal on Ubuntu 14.04? I've installed on Ubuntu 14.04 and with I've Broadband connection setup, Browser connection is OK,  but Terminal not connection via internet, when command type "sudo apt-get update" by terminal then showing me Error, see screenshot, How I can fix this ? Help me to solve this problem please..  Let $Y_{(1)}, Y_{(2)}, Y_{(3)}, Y_{(4)}, Y_{(5)}$ denote the order statistics of a random sample of size 5 from a distribution having p.d.f. $f(y) = e^{(-y)}, 0 &lt; y &lt; \infty$, zero elsewhere. Show that $Z_1 = Y_{(2)}$ and $Z_2 = Y_{(4)} − Y_{(2)}$  are independent. Hint: First find the joint p.d.f. of $Y_{(2)}$  and  $Y_{(4)}$. I need another LP-E5 type battery for my Canon 450D. Should I buy an original Canon battery or one of the many generic brands available? There are loads of cheapos on , for example.  I should add that the new battery will be added to my existing Canon battery in a battery grip.  Does anyone have any experience (good or bad) of using generic batteries? jQuery Validate Plugin - How to create a simple custom rule? How do you create a simple, custom rule using the jQuery Validate plugin (using ) that doesn't use a regex?  For example, what function would create a rule that validates only if at least one of a group of checkboxes is checked? Are the WotC archives of d20 Character Optimization forum forever lost? I was looking for the Wizard Handbook but all the links were broken.  Somewhere on the handbooks of other classes (on other forums) I saw a      This was archived by WotC, here's the link   But the link leads to the welcome page of WotC (since it's broken).  Is there a way to get all that info back? Do you know where to get it from? The Wayback Machine did not archive the forums. Stretch and scale CSS background Is there a way to get a background in CSS to stretch or scale to fill its container? I am trying to use the MailManager class in Drupal 8 to send HTML mail. I got it working, but it isn't parsing the HTML markup. I think something is wrong with the headers of the email.  What I have is a custom module (Custom_forward) that contains a form and that calls Mailmanager::mail() in its submitForm() method, which contains the following code.          // Email body         $header = $sender . ' thought you would like to see this page from the website.';         $personal_message = $form_state-&gt;getValues()['message_body'];         $entity_url_value = '&lt;a href="' . $entity_url-&gt;toString() . '"&gt;Go to article&lt;/a&gt;';         $message = $header . '&lt;br&gt;' . $personal_message . '&lt;br&gt;' . $entity_url_value;          // Email         $langcode = 'en';         $mailManager = \Drupal::service('plugin.manager.mail');         $to = $form_state-&gt;getValues()['recipient'];          $params['title'] = 'Forward';         $params['message'] = $message;         $result = $mailManager-&gt;mail('custom_forward', 'forward', $to, $langcode, $params, NULL, true);          if ($result['result'] !== true) {             drupal_set_message(t('There was a problem sending your message and it was not sent.'), 'error');             \Drupal::logger('mail-log')-&gt;error($message);         }         else {             drupal_set_message(t('Your message has been sent.'));         }   According to Drupal you also need the hook_mail method in mytheme.theme to be able to send message, you can see this method here:  function custom_forward_mail($key, &amp;$message, $params) {   $message['body'] = [];   $message['subject'] = [];   $message['headers'] = array(     'content-type' =&gt; 'text/html',     'charset' =&gt; 'UTF-8',     'format' =&gt; 'flowed',     'delsp' =&gt; 'yes',     'from' =&gt; \Drupal::config('system.site')-&gt;get('mail')   );    switch ($key) {     case 'forward':       $message['subject'] = $params['title'];       $message['body'][] = '&lt;html&gt;&lt;body&gt;' . $params['message'] . '&lt;/body&gt;&lt;/html&gt;';       break;   } }   As you can see, I am setting the content type to text/html and that should tell the mail system to parse the content as an HTML, but this is not working for some reasons.  This is a testing email. All the HTML markup is not shown, but also not working.  Bassem thought you would like to see this page from the website. personal message Go to article [1] [1] http://myhost/node/81 I've found strange behavior when closing this  - I definitely see that there are 3 closing votes and 2 of them are at "Off-topic" section:   -but there are no explanations on section itself:   -while, normally, it's expected that it will appear. In custom comments section there are also no closing-votes displayed.   Perhaps it's just my browser (which is FF 26 x64 under Win) - so marking this as a "possible bug". Thank you for your attention. Why is the space between words in my source code listing so big? I used the following code to list my java code, but the it looks like there's too much space between words. What can I do?  % source code listing \usepackage{listings} \usepackage{color} \usepackage{xcolor}  \usepackage{caption}  % citation style \usepackage{apacite} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}  \begin{document} \begin{lstlisting}[label=some-code,caption=bind to service call] bindService(new Intent(this, Recognizer.class), recConnection, Context.BIND_AUTO_CREATE); \end{lstlisting} \end{document}   The snapshot of what I got. The code not completely shown, and space too wide, in function bindService. How can I update to Ubuntu 21.04? Today is the release of Ubuntu 21.04 (Hirsute Hippo). And I can't update to this version. And also I selected ‘Notify me of a new Ubuntu version’ and changed it to ‘For any new version' on the Updates tab on Software &amp; Update, but it's still not working. In addition, in the terminal, I've written: sudo do-release-upgrade -c  And output was: Checking for a new Ubuntu release No new release found.  What should I do? How to see the full date on macOS Big Sur? Prove the following in $S_n$:  Let $\alpha = (a_1,a_2,\ldots,a_s)$ be a cycle and let $\pi$ be a permutation in $S_n$. Then $\pi\alpha\pi^{-1}$ is the cycle $(\pi(a_1),\ldots,\pi(a_s)).$     I'm not sure where to even start. SELECT permission on view querying table from another database SQL Server 2008 R2 SP1  My company uses the Great Plains (GP) financial system with several customizations.  Our Value-Added-Reseller (VAR) for GP has setup most of these customizations in a separate database from the GP data called DYNCUSTOM.  In the DYNCUSTOM database is a View that is merely a SELECT * FROM a table in the GP company database (called PARTS).  I was approached by a user having problems trying to select on this view.  The error he was getting:  Msg 229, Level 14, State 5, Line 2 SELECT permission denied on object 'BM010415', database 'PARTS', schema 'dbo'   I looked at how his login was mapped and he had a database user in the DYNCUSTOM database belonging to a database role that was granted select on the view.  However, he did not have a database user in the PARTS database.    Usually the intent of a view is so that one can grant select permissions on the view without exposing access to the underlying table.  With SQL Server however, if the view crosses databases does it then change the security context being used?  Therefore, the user would also need a database user in the PARTS database as well as granted select access to the underlying table? Someone flagged my question as already answered, but it's not How to get the current user in ASP.NET MVC Can you prove that if $p$ is a prime greater than $5$, then the sum of the squares of the quadratic nonresidues modulo $p$ is divisible by $p$?  Note that I have just proved that the sum of the quadratic residues modulo $p$ is divisible by $p$ for $p$ greater than $3$. Is Ghost Adventures real or fake?