jquery Get file Select the extension of the input box
var file=$ ("Input[name= ' file ']"). Val () var filename=file.replace (/.* (\/|\\)/, ""); File name var fileext= (/[.) /.exec (filename))? /[^.] +$/.exec (Filename.tolowercase ()): "; Extended Name
Today when using Ajaxfileupload, encountered a to refresh the page to upload again, using the Live () method to bind <input type= "File" > The Change event can be resolved? Direct $ ("xxx"). change (); Can only be called once, reportedly is the security of IE browser. Finally found a solution. IE browser <input type= "file" > choose to complete the automatic submission of the problem, after each processing is completed <input type= "file"/> replaced with the original code, and then add a different attribute. As in this example, the title is added.
var count =-1; $ ("#upload"). Live ("Change", function () { count++; $.ajaxfileupload (config); $ ("#upload"). ReplaceWith ("<input type= ' file ' id= ' upload ' name= ' upload ' style= ' position:relative; top:0px; left:-240px; width:346px; height:46px; opacity:0; Filter:alpha (opacity=0); Cursor:pointer; Title= "+ count +" '/> ");})
jquery calculates age, Constellation, and zodiac examples based on birthdays:
jquery Determines if there is another specified element under the element
$ (this). have ("P"). Length > 0//This code means that the number of current elements containing p, if it contains P is 1, does not contain P is 0. Because $ (this) is definitely 1, add a condition to it, containing P's $ (this) if it is 1, or 0.
Another way is to use find
$ (this). Find ("P"). Length > 0//The sentence code means that the number of P sub-elements contained is greater than 0
jquery determines whether the current element is hidden or displayed
$ (this). Is (": hidden"); Returns True if the element is hidden
is very useful, he can use the jquery selector as a parameter, especially with jquery inside the selector of those with a colon beginning with the filter, to achieve a variety of judgments. such as: ": Checked,:hidden" and so on. Give an example: