What I am trying to do is get the id name of newly added item in the list on click. Here's my code.    $(document).ready(function() {    $('ul&gt;li').on('click', function() {     var idName = $(this).attr('id');     alert(idName);   });    $('#add').click(function() {     var n = Math.floor((Math.random() * 100) + 1);     $('ul').prepend('&lt;li id="name-' + n + '"&gt;New Item&lt;/li&gt;');   });  }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;  &lt;ul&gt;   &lt;li id="name-88"&gt;Old Item&lt;/li&gt;   &lt;li id="name-59"&gt;Old Item&lt;/li&gt;   &lt;li id="name-48"&gt;Old Item&lt;/li&gt; &lt;/ul&gt; &lt;button id="add"&gt;Add Item&lt;/button&gt;
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.
ceiling fan from a switch with only black and red wires? The current switch controls an outlet in the corner of the room for a lamp. I pulled it out and noticed three sets of individual wires: two set of wires coming up into the box from the bottom, and one set with a red wire coming down into box.  All the white and grounding wires are capped.  Also all the black wires are capped; one set I’m assuming is the hot since I see it contains a red wire. On the back of the switch, the top two ports have black wires and the bottom right has the one red wire.  There are two black pigtail wires coming off the black capped wires. I tried to connect a separate switch to control a ceiling fan with remote. I ran new wire making the old switch box into a two switch. I ran 14/2 gauge wire to ceiling for fan / light remote combo. Fan didn’t work after multiple re-wiring  combinations. The breaker did pop and half click when it popped. Then I thought to re-wire the ceiling fan wires as if I was going to make it into outlet only and use a tester to indicate an open ground, or a wiring error but the two light on tester are both orange indicating correct wiring. I heard that sometimes the ceiling fan remote transformer goes bad. Should I check batteries and/or unit placement? I’m really confused at this point why the light is not working at least with remote after follow wiring installation instructions that were included with the fan. I think it’s my wiring with the switch. The way I left the wiring is that it has constant power. As if we’re a outlet the current switch does not turn it off. In C/C++, are global variables as bad as my professor thinks they are? This is what happens:  sudo apt-get install vlc Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package vlc   Please help. I would also like to know when this error occurs, I've seen it before too. how to set camera to the same view as I turn my cursor? I want to turn the camera to get the view I want, but everytime I turn the camera, I need to go to render window to check if it's the view I want. I turn the view with my mouse cursor, but that does not affect the actual camera view in rendering, can I set the camera view the same as I turn my cursor? Error on \usepackage {geometry} text property The following produces error! The error is solved if no space exists between text= and {5in,8in}. This is really weird! Why is this happening with LaTeX?  \documentclass[a4paper,10pt,onecolumn,oneside, portrait]{article}  \usepackage[text= {5in,8in},centering]{geometry}  \begin{document}      \section{What Endogenous uncertainty is:}  yes  \subsection{Type as it is : Stochastic and determ! } on  \subsubsection{Well there is more than it} Yes    \end{document} Why Smart's attack doesn't work on this ECDLP? Problem recreating BCD on Windows 7 64bit - The requested system device cannot be found How to kill all process with given name? How to extract Time from Date/Time field within formula Do cards with abilities that target trigger heroic? I'm being asked to find 2 subgroups of $S_3$, one of which is normal and one that isn't normal. I guess, to find the non normal subgroup is easier. I would do this by trial and error, but since the group is $S_3$ and easily visualizable, I guess that there should be a geometrical property that makes it easy to find a normal subgroup. Any of you guys know one? Or should I try this by brute force? Drupal unexpected "Fatal error: Class name must be a valid object or a string [...] common.inc" on every page "Fatal error: Class name must be a valid object or a string in C:\xampp\htdocs\uc\includes\common.inc on line 7506"  The error above showed up unexpectedly. I was adding a "Long text" field to a content-type, but when I expected to be brought to a saved field configuration page, I instead got a Fatal error on every page.  I had a look at includes\common.inc:  /**  * Get the entity controller class for an entity type.  */ function entity_get_controller($entity_type) {   $controllers = &amp;drupal_static(__FUNCTION__, array());   if (!isset($controllers[$entity_type])) {     $type_info = entity_get_info($entity_type);     $class = $type_info['controller class'];     $controllers[$entity_type] = new $class($entity_type); // Line 7506   }   return $controllers[$entity_type]; }   However, I just don't understand Drupal at a low enough level to understand the relationships between these variables and functions.  I also searched Drupal for people with a similar problem:  (1)  who claims that I have to install the submodule "Relation Endpoints Field", but searching Drupal, .  (2) :  DELETE FROM cache; DELETE FROM cache_filter; DELETE FROM cache_menu; DELETE FROM cache_page; DELETE FROM watchdog;   (via , misleading name, I know.)  Clearing those tables from the cache did not help.  (3) And another user . Because I can't find a module specifically pertaining to old search facets, I went into MySQL system table, and marked the Search module's line with a 0 status, indicating to stop loading the module altogether.  On that same link as (3), one user suggested enabling the , so I dropped all the tables, imported the latest stable .sql, and installed the module, but after recreating the problem (trying to add a field to a content-type), that as well concluded fruitless.  Still, the problem remains  The Fatal error shows up on every page, making the site completely non-functional. Any help or direction would be immensely appreciated. Thank you for looking. What is a word for a person who uses resources to the maximum? Is there a word (or words) for a person who uses all resources to the maximum; for example, a person who keeps on using pencils even if they are very small? Calculating centroids of polygon using ArcPy? I am trying to calculate the centroids of a polygon and add the x- and y-coordinate to their respective fields:  arcpy.env.workspace = r"C:/..."  input_fc = "shapefiles/precincts_v.shp" arcpy.AddField_management(input_fc, "X", "DOUBLE") arcpy.AddField_management(input_fc, "Y", "DOUBLE")  arcpy.CalculateField_management(input_fc, "X", "!SHAPE.CENTROID@DECIMALDEGREES!.split()[0]", "PYTHON")  arcpy.CalculateField_management(input_fc, "Y", "!SHAPE.CENTROID@DECIMALDEGREES!.split()[1]", "PYTHON")    but I an invalid syntax error. Where is the mistake?  Edit: exact error message  Traceback (most recent call last):   File "C:\Users\mquentel\Dropbox\PLSS\CA voting data\Python\CONSTRUCT_merge_voting_and_census.py", line 17, in &lt;module&gt;     arcpy.CalculateField_management(input_fc, "X", "!SHAPE.CENTROID@DECIMALDEGREES!.split()[0]", "PYTHON")   File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\management.py", line 3360, in CalculateField     raise e ExecuteError: ERROR 000539: SyntaxError: invalid syntax (&lt;expression&gt;, line 1) Failed to execute (CalculateField). ActionBarSherlock with ViewPager not calling ViewPager fragments lifecycle methods when going to and returning from backstack Cannot set LC_CTYPE to default locale: No such file or directory Why time is considered a dimension? Why is time considered to be a dimension? And the other 7 (except the 3 dimensions of space, and the dimension of time) dimensions that string theory suggests, why can't they be realized? Story about protagonist finding a world that has died with a museum Dealing with questions of nefarious intent The definition for marker below is from tcolorbox.doc.s_main.sty. With earlier versions of Texlive (and tcolorbox), this worked fine, but with updated Texlive, it does not.  \documentclass{article} \usepackage{xcolor,tikz,tcolorbox} \usetikzlibrary{shadows} \tcbuselibrary{skins,hooks} \makeatletter % from tcolorbox.doc.s_main.sty \newtcolorbox{marker}[1][]{enhanced,   before skip=2mm,after skip=3mm,   boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,   colback=yellow!50,   colframe=yellow!20!black,   sharp corners,rounded corners=southeast,arc is angular,arc=3mm,   underlay={%     \path[fill=tcbcol@back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);     \path[draw=tcbcol@frame,shorten &lt;=-0.05mm,shorten &gt;=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);     \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);     },   drop fuzzy shadow,#1} \makeatother   \begin{document} \begin{marker}   Hylo! \end{marker}  \end{document}   This gives the following error  ! Package xcolor Error: Undefined color `tcbcol@back'.  See the xcolor package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.34 \end{marker}  ?   Why are tcbcol@back and tcbcol@frame undefined if they work in the code for the package's documentation? Alternatively, what are the correct names for the colours which were tcbcol@back and tcbcol@frame?  My version of tcolorbox is 2019-09-19.