chrome.tabs.executeScript(null, {code:"$.each(selectValues, function(key='" + timestamp + "', value='Custom')
{
$('#expire').
append($(\"<option></option>\").
attr(\"value\",key).
text(value));
});"});
It says that the first line has a syntax error, and the WebKit inspector shows odd highlighting patterns.
What’s wrong with that? A friend thinks I need to escape some characters somewhere.
Thanks for the help!
That’s definitely not valid syntax. You have an equal sign in the formal parameter list.
It will presumably end up as:
I recommend you use the file option if possible, so you don’t have to deal with escaping issues:
The presumably the code in myScript.js will be something like:
However, it’s not clear what you’re trying to do. jQuery.each takes a callback with two parameters, but what do you expect to happen to the values on the right of the equal sign?