Ajax click function doesn't work after load content I have following problem. If I generate anhor "load_more_btn" via ajax then click function (the one with alert('test') ) wont work. Why is this happens and how to solve this problem?  &lt;div id="content"&gt;&lt;/div&gt; &lt;div id="load_more"&gt;&lt;/div&gt;          &lt;script type="text/javascript"&gt;         function getPhoto(paramType, param, page){             $.ajax({                 url: "skrypt.php?paramType="+paramType+"&amp;param="+param+"&amp;page="+page             }).done(function(data) {                                             $('#content').html(data);                 var nextpage =page+1;                 $('#load_more').html('&lt;a href="#" id="load_more_btn" data-paramType="'+paramType+'" data-param="'+param+'" data-page="'+nextpage+'"=&gt;Wczytaj więcej&lt;/a&gt;');             });         }          $('#load_more_btn').click(function(){                 alert('test');             });      &lt;/script&gt;
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.
Add custom command in the open with dialog? In earlier versions of Ubuntu (10.10-) there was an option in the "open with" tab in the properties window, to add a custom command to open a file. However, this is no longer the case in Ubuntu 11.10. Is there any way that I can add these file type associations with a command of my choice rather than the applications detected by the system. Time Capsule cryptography? Does there exist any cryptographic algorithm which encrypts data in such a way that it can only be decrypted after a certain period of time?  The only idea that I can think of, is something like this: Seed a PRNG with a public value. Run the PRNG for a week and use the final value it produces to encrypt the message. Now anyone who runs that PRNG for a week starting from the seed value you made public can decrypt the message. Obviously this breaks down since they could use more computational power than you; if the time span was years then Moore's Law would apply, etc.  Is there anything like this other than physically burying a private key on a USB stick in a literal time capsule? What is a field, really? Please revoke badges gained by abusive voting In  (not feature request), :  ... if we find that people are abusing the system their accounts may get suspended. I would consider that kind of behavior abuse.  Well  sure qualifies. He has 11 Stack Exchange accounts and has in the last day spammed at least 8 of them to gain the Suffrage and sometimes Vox Populi badges. That's over 250 votes† in just a few hours! (And  -- while voting on other user's posts too.) I guarantee that he's not voting on those posts for/by their merits. Here's when he scammed the Suffrage badge per site (while also gaming the Vox Populi on some sites):                      - 2017-03-11 16:23:15Z                     - 2017-03-11 17:41:41Z                     - 2017-03-11 18:08:13Z                           - 2017-03-11 19:25:10Z                  - 2017-03-11 19:55:16Z                               - 2017-03-11 20:00:49Z               - 2017-03-11 20:03:13Z  - 2017-03-11 21:11:40Z  Note that he got the badge on three sites within an 8 minute span (but that might just be job run times). Please revoke badges gained through improper voting. And, maybe also warn/suspend such abusive voters.   † His account vote totals don't show all votes as some serial voting was reversed -- but none of the ill-gotten badges were. Why are there no line numbers in the code listings? Would it make discussing code easier if you could simply refer to a particular line or range, or am I wrong? How to calculate $(G/H)/(K/H)$? I have a group $G=\mathbb{Z}_{36}$ with normal subgroups $K$ and $H$, where $H$ is also a normal subgroup of $K$. What I'm really supposed to find is a bijection between $G/K$ and $(G/H)/(K/H)$ by using the third isomorphism theorem. I have already calculated $G/K$, $G/H$ and $K/H$, but I do not really know how to calculate $(G/H)/(K/H)$. Say that one of the elements in $G/H$ is $\{0,18\}$ and one of the elements in $K/H$ is $\{0,18\}$. Will one of the elements in $(G/H)/(K/H)$ be as follows? $$\{0,18\}+\{0,18\} = \{0+0,18+18\}=\{0,36\}=\{0\}$$ Another way I'm thinking it's possible to caluclate is $$\{0,18\}+\{0,18\} = \{0+0,0+18,18+0,18+18\}=\{0,18,18,36\}=\{0,18\}$$ Is any of these a correct way of calculating an element in $(G/H)/(K/H)$? What's the best practice of inserting a collection of data into a SQL Server database Is it "a SSD" or "an SSD"? Possible Duplicates:             Since SSD (solid-state drive) is pronounced es-es-dee, I'm wondering whether one should write "an SSD" or "a SSD". Saying "a SSD" out loud feels a bit off... Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered? In MLE for continuous rv, why is it ok to evaluate a pdf at a point? I recall Asimov had a character who was The autoc of , clearly based on the word “autokrat” but I don’t recall the exact spelling.  This stumped Google, which would rather correct the spelling to some other word than find a unique word.  In the story, he had gone undercover and the reader did not know either that some other character was in fact the Autoc, until it had been revealed to the main character. Create Trigger that updates the same table before (or after ??) the Insert I have just started using triggers and one thing that I would need to do is to create a trigger that updates the same table that's inserting the row.  TABLE:  CREATE TABLE `city` (   `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `city` varchar(50) NOT NULL,   `country_id` smallint(5) unsigned DEFAULT '0',   `country` varchar(150) DEFAULT NULL,   `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,   PRIMARY KEY (`city_id`),   KEY `idx_fk_country_id` (`country_id`),   CONSTRAINT `city_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=6009 DEFAULT CHARSET=utf8;   Trigger:  DELIMITER $$ CREATE TRIGGER `populate_country_id` BEFORE INSERT ON `city` FOR EACH ROW BEGIN  IF NEW.country_id = 0  THEN     UPDATE city     INNER JOIN country B ON city.country = B.country     SET NEW.country_id = B.country_id;  END IF;  END $$ DELIMITER ;   MySQL is just returning: Can't update table 'city' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.  Is there any way I can make this work?  Thanks everyone! For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here:   I am running into a problem however when wordpress auto saves itself, it clears whatever metadata i have put into the forms.  EXAMPLE:  I select the 3 drop downs I want from my metabox and hit update.  The page reloads and the 3 choices are still selected.  In phpMyAdmin i can look up the metadata and see the array in place as it should be.  I now wait for wordpress to auto save.  As soon as this happens i can either refresh the page (not update, just refresh) and the metadata is lost, or i can look up the metadata in phpMyAdmin and it will display nothing (ie: its gone).  I'm guessing that this has something to do with needing to tie into another hook (some sorta auto update hook) or something, but even then it doesn't make sense that it would actually delete your metadata (rather than just not auto updating it).  Last note: If you copy and paste Mikes code into functions.php, you should be able to recreate my error (in wordpress 3.1) very easy. LaTeX Error: Option clash for package xcolor I am in 1.13 Pre-Release 7 trying to make a one command creation and I need an item with a specific name. The command I use is /give @p diamond_sword{display:{Name:"Sword of Power"}} and it gives my a diamond sword, but it doesn't have the name.   This is me running the command.   This is the command not working. I've found ,  and  which are releated to my question, but no longer seem to apply since Drupal 8.1 and the deprecation of .  Also popular guides such as  appear to no longer apply as they also mention composer manager.   The other solution opposed to composer manager, alter the core composer.json file feels like too much core hacking and would probably break with every Drush update of Drupal core(?).  More specifically, I am attempting to update  from Drupal 7 to 8. I have created my composer.json file as follows:  {   "name": "drupal/views_vcards",   "description": "Allows creation of vCards using the fields provided by the Views module.",   "type": "drupal-module",   "license": "GPL-2.0+",   "homepage": "https://drupal.org/project/views_vcards",   "require": {     "maennchen/zipstream-php": "0.3.*"   } }   But if I put a composer.json file in my module folder, how do I make Drupal aware that that file is there, and how do I make sure the required zipstream-php library is downloaded?  Simply running composer update from the Drupal root does update a lot of Drupal dependencies, but it does not include the composer.json files that are in the modules folders. I also don't assume I should be calling composer install from inside all modules with dependencies.  How do I make Drupal aware of a module's dependency without using composer manager and/or hacking core?  UPDATE:  The  appears to have support a wildcard path:  {     "require": {         "wikimedia/composer-merge-plugin": "dev-master"     },     "extra": {         "merge-plugin": {             "include": [                 "composer.local.json",                 "extensions/*/composer.json" // &lt; ---- THIS LINE             ],             "require": [                 "submodule/composer.json"             ],             "recurse": true,             "replace": false,             "merge-dev": true,             "merge-extra": false         }     } }   Why doesn't core merge modules/*/composer.json, that would solve everything right?  Update 2:  THe reasoning for not supporting this is covered in  (which also has been quiet for some time now). Why is a method not identical to itself? I want to make a logistic model from my survey data. It is a small survey of four residential colonies in which only 154 respondents were interviewed. My dependent variable is "satisfactory transition to work". I found that, of the 154 respondents, 73 said that they have satisfactorily transitioned to work, while the rest did not. So the dependent variable is binary in nature and I decided to use logistic regression. I have seven independent variables (three continuous and four nominal). One guideline suggest that there should be 10 cases for each predictor / independent variable (Agresti, 2007). Based on this guideline I feel that it is OK to run logistic regression.    Am I right? If not please let me know how to decide the number of independent variables? How does "this" keyword work within a function? I just came across an interesting situation in JavaScript.  I have a class with a method that defines several objects using object-literal notation.  Inside those objects, the this pointer is being used.  From the behavior of the program, I have deduced that the this pointer is referring to the class on which the method was invoked, and not the object being created by the literal.    This seems arbitrary, though it is the way I would expect it to work.  Is this defined behavior?  Is it cross-browser safe?  Is there any reasoning underlying why it is the way it is beyond "the spec says so" (for instance, is it a consequence of some broader design decision/philosophy)?  Pared-down code example:  // inside class definition, itself an object literal, we have this function: onRender: function() {      this.menuItems = this.menuItems.concat([         {             text: 'Group by Module',             rptletdiv: this         },         {             text: 'Group by Status',             rptletdiv: this         }]);     // etc } How to rotate the curve but not the axes?