3 Replies - 3815 Views - Last Post: 23 October 2013 - 02:44 PM

#1 ddeutsch  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 23-October 13

Firebug SyntaxError: missing ; before statement jquery

Posted 23 October 2013 - 02:19 PM

I am new with javascript/jQuery and am following some exercises in a book to see how it works and is coded. I've checked my version of the code countless times for typos that may differ from what is in my book. It's probably a typo in the book and I'm not sure what is right now. I can't find where I'm missing a ; as the error says on the line in red below.

<script type="text/javascript">
        $(document).ready(function() {
		$("input[name='trim']").click(function(event) {
$if ($(this).val() == "deluxe") { <-------------------------------- error line from Firebug appears here: missing ; before statement
				$("input[name='option']").attr("checked",true);
			} else if ($(this).val() == "plain") {
				$("input[name='option']").attr("checked",false);
			}
        	});
        	$("input[name='option']").click(function(event) {
        		$("#custom").attr("checked","checked");
        	});
        });
        </script>


Is This A Good Question/Topic? 0
  • +

Replies To: Firebug SyntaxError: missing ; before statement jquery

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3369
  • View blog
  • Posts: 11,417
  • Joined: 12-December 12

Re: Firebug SyntaxError: missing ; before statement jquery

Posted 23 October 2013 - 02:22 PM

You have an incorrect dollar-sign, $if.
Was This Post Helpful? 2
  • +
  • -

#3 ddeutsch  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 23-October 13

Re: Firebug SyntaxError: missing ; before statement jquery

Posted 23 October 2013 - 02:34 PM

View Postandrewsw, on 23 October 2013 - 02:22 PM, said:

You have an incorrect dollar-sign, $if.


Good lord! I overlooked something so small while looking for missing ";" and/or "{" "(" etc so many times re-reading the code. Thank you so much for your input.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3369
  • View blog
  • Posts: 11,417
  • Joined: 12-December 12

Re: Firebug SyntaxError: missing ; before statement jquery

Posted 23 October 2013 - 02:44 PM

No worries.

The interpreter identifies the position at which it knows that an error has occurred. We generally have to work back a little bit to discover the source of the error ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1