Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1980
  • Last Modified:

SyntaxError: invalid property id

I'm getting this error for line 4 in jslint.

function createResultItem(type, resultList, result) {
	var listItem = $('<li/>');
	listItem.attr(
		{class:"listItem", category:type, placeid:result.place_id});

Open in new window

0
seopti
Asked:
seopti
1 Solution
 
käµfm³d 👽Commented:
"class" is a reserved word in Javascript. You'll have to quote it.

e.g.

		{"class":"listItem", category:type, placeid:result.place_id});

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now