I have a program where I generate a folder, its subfolders and files, and when I click the file, it has to show its content. My problem is that when I click, the function isn't called.  This is my function:       function printFile(params) {             //alert("Hello");             $.ajax({                     method: "GET",                     url: "getFile.php",                     data: {                         q: params                     }                 })                 .done(function(msg) {                     $("#continut").html(msg);                 });      }      window.onload = function(){         //alert("Hello");         $("li").click(function() {              printFile(this.id);         });      };   This is the body:  &lt;?php     function listAll($path, $test) {          $fileList = glob($path);          //Loop through the array that glob returned.         foreach($fileList as $filename){         $pieces = explode("/", $filename);         if($test == 0){         if (strpos(end($pieces), '.') !== false) {         echo '&lt;li class="file"&gt;'.end($pieces)."&lt;/li&gt;", '&lt;br&gt;';          }         else         echo '&lt;ul class="folder"&gt;'.end($pieces).'&lt;/ul&gt;', '&lt;br&gt;';          }         else         {         $spaceValue = 40*$test;         echo '&lt;ul class="spaceDiv" style="margin-left: '.$spaceValue.'px;"&gt;';         if (strpos(end($pieces), '.') !== false) {         echo '&lt;li class="file" id="'.$filename.'" value="test"&gt;'.end($pieces)."&lt;/li&gt;", '&lt;br&gt;';          //echo $path;         }         else         echo '&lt;ul class="folder"&gt;'.end($pieces).'&lt;/ul&gt;', '&lt;br&gt;';          echo '&lt;/ul&gt;';         }         listAll($path.end($pieces)."/*", $test+1);         }     }      listAll("D:/xampp/htdocs/*", 0);    ?&gt;   And this is getFile.php:  &lt;?php       $val = $_GET['q'];      $fh = fopen($val,'r');     while ($line = fgets($fh)) {         echo($line."&lt;br&gt;");     }     fclose($fh);   ?&gt;   What can I do to call the function printFile on generated li?
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.
How to attach my repo to heroku app I think my MacBook Pro battery was replaced by Apple's service team. How do I check that? I handed my MacBook Pro (15" Touch bar) to the service centre in order to have the keyboard replaced. Now, when I check the battery cycle count, it shows "1". Before it was at "82".   Also, I'm getting a battery life of only 4.5 - 5 hours now.   Is there a way to find if my battery was replaced or not? How can I use wget to get files recursively if the username contains an @? Firstly my main goal is to try and get FTP files recursively in Centos.  However the actual FTP login contains an @ which ruins the syntax.  Is there some way to place the username in "double quotes" or some such equivalent such that I can use @in the username? Disabling IPv6 on Mint and Debian How does one disable IPv6 completely (for all interfaces, resp. for the whole machine?  Keep in mind, I don't want any kind of GUI solution.    OS in question:   Linux Mint 18.x Cinnamon 64-bit GNU/Linux Debian 9.x Cinnamon 64-bit [Probability]need help to understand the following expression So assume $Y$ and $X$ are exponentially distributed with parameters $y_1$, and $x_1$ respecitively.  assume c is a constant.  I am having huge trouble to understand the integration of the following expression.  $P(Y&lt;c/u(X))$  $=\int_{t}^{\infty}f_X(x)\int_{0}^{c/u(x)}f_Y(y)dydx +\int_{0}^{t}f_X(x)\int_{c/u(x)}^{\infty}f_Y(y)dydx$  where t is the cross-point that $u(x)$ change sign    here $c/u(x)$ is given by the plot below, t is the point crossing the zero:   Confusion:   I don't understand the second integration of the second term "$\int_{c/u(x)}^{\infty}f_Y(y)dydx$", this isn't right because Y an X only defined for y>0, and x>0. So it's the first quadrant in this plot. Can't mount an IDE HDD - "can't read superblock" error message I'm trying to mount my HDD,  /dev/sdb, which is connected via an enclosure but every time I try do so I get an error message   mount: /dev/sdb: can't read superblock   How do I solve this problem and mount my HDD? Difference between pre-increment and post-increment in a loop? Is there a difference in ++i and i++ in a for loop? Is it simply a syntax thing? Weapon damage bonuses and critical hits What do you call a person who "shuts down" ideas? Even if many interesting similarities between the classical and the quantum mechanical framework have been worked out, e.g. in the subject of deformation quantization, in general, there are some mathematical problems. And in the conventional formulation, you don't want to make things like $\hbar\rightarrow 0$ for the expression $P=-\text i\hbar\tfrac{\partial}{\partial x}$.   In special relativity there are many formulas where one optains the non-relativistic formula by taking the naive limit $c\rightarrow \infty$, e.g.  $$\vec p=\frac{m\vec v}{\sqrt{1-|v|/c}}\ \rightarrow\ \frac{m\vec v}{\sqrt{1-0}}=m\vec v.$$  I wonder if it is know that you can always do that. Is there a formulation of special relativity (maybe it's the standard one already), where the starting assumptions/axioms/representations of objects of discourse involve the constant $c$, and as you take them with you to do all the standard derivations, you always end up with results which reduce to the Newtonian mechanics if you take that limit? Why $9$ & $11$ are special in divisibility tests using decimal digit sums? (casting out nines & elevens) I don't know if this is a well-known fact, but I have observed that every number, no matter how large, that is equally divided by $9$, will equal $9$ if you add all the numbers it is made from until there is $1$ digit. A quick example of what I mean:  $9*99 = 891$ $8+9+1 = 18$ $1+8 = 9$  This works even with really long numbers like $4376331$ Why is that? This doesn't work with any other number. Similarly for $11$ and alternating digits sums. Prove $e^{x+y}=e^{x}e^{y}$ by using Exponential Series In order to show $e^{x+y}=e^{x}e^{y}$ by using Exponential Series, I got the following:   $$e^{x}e^{y}=\Big(\sum_{n=0}^{\infty}{x^n \over n!}\Big)\cdot \Big(\sum_{n=0}^{\infty}{y^n \over n!}\Big)=\sum_{n=0}^{\infty}\sum_{k=0}^n{x^ky^n \over {k!n!}}$$  But, where should I go next to get $e^{x+y}=\sum_{n=0}^{\infty}{(x+y)^n \over n!}$.  Thanks in advance. How to disable SSLv2 or SSLv3? So here is the problem      Solve $$4^x + 6^x = 9^x$$ for $x$.   I am trying to find its real solution.  I was trying in this way!! $$6^x\left( \frac {4^x}{6^x} + 1\right) = 9^x$$ $$\left({\frac 23}\right)^x +1=\left({\frac 32}\right)^x$$ but I'm stuck . . . Will anyone help ? Can a character escape the  (DMG p. 177, listed in the SRD as the ) with the  spell? To clarify, I am not asking if the bands prevent teleportation. I am asking whether the bands are teleported with the character as he teleports using misty step. Why is an orthogonal matrix called orthogonal? Can't launch graphical apps from terminal after updating to 15.10 Making crafted items usable in adventure mode In a map I'm making the player has to survive while locked in a maze. To stop them from breaking out, they will be in adventure mode. However, I still want them to be able to craft items and use them with specified blocks. I have tried several methods already but they all have a flaw.  One method is to have a scoreboard objective called item and giving certain item entities a specific score using something like:  /scoreboard players set @e[type=Item] item 1 {Item:{id:"minecraft:sapling"}}   Then it is possible to select these items with:  /entitydata @e[type=Item,score_item=1,score_item_min=1] {Item:{tag:{CanPlaceOn:["dirt"],HideFlags:24}}}   This works but it requires the item to be dropped, which isn't a problem for saplings, but for tools and other craftable items, it becomes a hassle.  To fix this, I'm currently clearing tools without damage and giving the player a slightly damaged tool in return:  /clear @a minecraft:stone_axe 0 1   /give @a minecraft:stone_axe 1 1 {CanDestroy:["log","log2","leaves","leaves2"],HideFlags:24}   This doesn't work for items without damage values (e.g. torches), but I don't mind these having to be dropped as there aren't too many of these. However, there is another problem. In the nether, the player will have access to an enchantment table and an anvil. This means they can repair enchanted tools, which will cause them to be cleared and replaced with unenchanted ones as soon as they go back to the overworld.  I also thought about using a stat.craftItem scoreboard objective and giving them the usable item if they craft it. However, this would result in the player having a duplicate of every item they crafted, as I think it is impossible to select an item without NBT-data in the /clear command.  Is there any way to make this work? And if not, would it be better to have the player drop all crafted items or have duplicates of them all? GIS Point or discrete longitude and latitude columns? I've been using Texmaker for ~5 years now and prefer it over other editors because of its flexibility.   Is there a way to auto-indent LaTeX code in TeXmaker so that the code becomes more manageable ?