Friday, 15 May 2015

Is my bracketing the issue here? Or is there really an unexpected identifier? Javascript/jQuery -


I am creating a simple app that increases the count down to each picture on click I think it's compiling a problem or I'm missing some silly and obvious

& lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Cat clicker & lt; / Title & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = 'app.js' & gt; & Lt; / Script & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; Cat clicker & lt; / H1> & Lt; Img class = "catpic_one" src = "cat.jpg" alt = "mountain view" style = "width: 304px; height: 228px" & gt; & Lt; P class = "counter_one" & gt; 0 & lt; / P & gt; & Lt; Img class = "catpic_two" src = "catpic2.jpg" alt = "mountain view" style = "width: 304px; height: 228px" & gt; & Lt; P class = "counter_two" & gt; 0 & lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt;

js

  $ (document) .ready (function () {var click_on = 0; var click_tobu = 0; $ ('# catpic_one') ("Click", "#counter_one", function () {clicks_one ++ var clickcount_one = clicks_one.toString (); $ ('# counter_one'). Attachment ("You clicked the cat # 1" clickcount_one "times." ) $ ('#cuper_two'). ("Click", "#counter_two", function () {clicks_two ++ var clickcount_two = clicks_two.toString (); $ ('# counter_two'). Clicked # 1 "clickcount_two" bar.);}});  

catpic_one and Catpic_two class is not id, please call ' # 'To'. ', like

  make changes to' Catpic_one 'and' .catpic_two ' 

No comments:

Post a Comment