Tuesday 15 July 2014

clear - I cannot get jquery 'change' to work, what am I doing wrong? -


I've tried ".change" and ".live changes" but without success The code below is one of the many copied from googled requests for examples. I believe I need to use the "live" change because in my code I'm dynamically creating input fields.

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Test change & lt; / Title & gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input id = 'inurlprodcgs' type = "url" name = "urlprodcgs" autocomplete = "close" required /> & Lt; / Body & gt; & Lt; Script & gt; If (type of jQuery! = 'Undefined') {Warning ("jQuery library is full!"); } And {warnings ("jQuery library is not found!"); } $ ("Input [type = 'url']"). Live ('change', function (e) {warning ("hide");}); & Lt; / Script & gt; & Lt; / Html & gt;   

As you can see that I have seen whether jquery has been loaded.

because the live ( as you are using 1.10 ) was removed Go to .on ()

  $ (document). ('Change', 'input [type =' url '] ", function (e) {warning (" hide ");});    

No comments:

Post a Comment