We're not all perfect, and sometimes we'll make mistakes when writing our JavaScript code; fortunately, iAd Producer has two built-in tools it uses to highlight and discover errors in your code.
If you have an error with your code syntax—the rules that define the structure of your code, iAd Producer will prompt you when you try to save that JavaScript file. iAd Producer identifies the line where your error occurs and allows you to save the file anyway (not recommended) or edit it.
General syntactical errors you should check for include:
Forgetting to end a line with a semicolon.
Not separating an object or array values with a comma.
Including a comma on the last item in an array or an object. For example,
['item one', 'item two', last item',]
would be incorrect as there is an extra comma at the end.Using the incorrect case. JavaScript and its variables are case sensitive, so
thisVariable
andThisVARIABLE
are considered two separate values.Forgetting to close...