ie7 Expected identifier, string or number with AJAX function

ajax, cross-browser, internet-explorer-7, jquery

Solution

You have to get rid of the trailing comma.

data: $('#add_positioning').serialize(), //this comma is the culprit

Problem

I ma using `AJAX` to update a database and it works well on all browsers except `IE7`. Before I give up and decide that users `IE7` should be asked to upgrade I thought I'd check and make sure I'm not missing something obvious seeing as I'm very new to `AJAX`. Script debugging throws an error saying '`SCRIPT1028: Expected identifier, string or number`' identifying the offending character as the second to last curly brace ``` <script> function save_pos_reasons() { $.ajax({ type: "POST", url: "save_pos_reasons.php", data: $('#add_positioning').serialize(), }); } </script> ``` And when I try to run the function it says `SCRIPT5007: The value of the property 'save_pos_reasons' is null or undefined, not a function object`. and identifies the line below as the cause. ``` <input type="button" class="submit" value="Save" onClick="save_pos_reasons()"/> ``` I am beginning to wonder if it is the `JQuery serialize function` that it is struggling with

Original source