onclick - jquery not triggering on click -
I'm starting to insert some amateur jQuery into my JGro project, and I'm having some trouble. The HTML head section of the file looks like this:
link rel = "stylesheet" href = "{{STATIC_URL}} / stylesheet / foundation.missings" & gt; & Lt; Script src = "{{STATIC_URL}} JavaScript / modernizr.foundation.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascript / jquery.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascripts / foundation.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} JavaScript / app.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascript / jquery.foundation.tabs.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Window) .load (function () {$ ('# slider'). Class ();}); & Lt; / Script & gt; & Lt; Script & gt; $ ('# Edit'). Click (function () {warning ("hey")}); & Lt; / Script & gt; In my body there is a button with id = "edit".
& lt; Button ID = "edit" square = "small button right" & gt; Izmeni & lt; / Button & gt; If I paste this code in jsFiddle it will work, I can see the alert. However, this does not work in my case. The only difference with JsFiddle is that I am using Zurb Foundation Framework, which comes with a lot of jQuery functions and they all work. Any help would be appreciated.
You must attach your event handler after into the element dom The reason is that it works in JSFDold because JSField automatically wraps its code inside $ .ready (function () {// your code here});
Comments
Post a Comment