JavaScript SCRIPT1002: Syntax Error, Line 1 Character 6 script1002 syntax error line 1 character 1

In the IE developer (F12) console, I've managed to get my pages to run without errors; all but one!

SCRIPT1002: Syntax error
mypage.php, line 1 character 6

I am using IE9. Whats it's problem?

This is my code:

<!DOCTYPE html>
<head>
  <script type='text/javascript' src='/files/jquery-1.7.2.min.js'></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $("#donateButton").click(function() {
        alert('hey');
      });
    });
  </script>
</head>
<body>
  <a target='_blank' href="javascript:void();" id="donateButton">asdsadasd</a>
</body>

When I click on #donateButton an error is produced. However, when I change javascript:void() to # then no error occurs any more. Why?

Answer:1

I have several images positioned on top of each other using absolute positioning. These images are partially transparent, and have a html area and map to make only the visible parts clickable. In ...

I have several images positioned on top of each other using absolute positioning. These images are partially transparent, and have a html area and map to make only the visible parts clickable. In ...

I'm currently working on a big JavaScript project and I'm struggling with mapping incomming JSON data (from the backend) to my own JavaScript objects. I am using the Knockout JavaScript MVVM ...

I'm currently working on a big JavaScript project and I'm struggling with mapping incomming JSON data (from the backend) to my own JavaScript objects. I am using the Knockout JavaScript MVVM ...

How do I enable exact match from start of string using jquery autocomplete with input from simple array? If i have the following in an array: smart oversmart smartland undersmart verysmart And if I ...

How do I enable exact match from start of string using jquery autocomplete with input from simple array? If i have the following in an array: smart oversmart smartland undersmart verysmart And if I ...

  1. autocomplete exact match in jquery

I have the following code: var formSubmitHandler = function (link, form) { //e.preventDefault(); var $form = form; var val = $form.valid(); var action = $(form).data('action'); ...

I have the following code: var formSubmitHandler = function (link, form) { //e.preventDefault(); var $form = form; var val = $form.valid(); var action = $(form).data('action'); ...