4
rated 0 times
[
5]
[
1]
/ answers: 1 / hits: 9081
/ 10 Years ago, wed, february 4, 2015, 12:00:00
I have some JS code that tried to append the JS file into header, but I have an error message on chrome Uncaught ReferenceError: Invalid left-hand side in assignment
and get different error on safari SyntaxError: Unexpected token ';'. Expected ']' to end a subscript expression.
, my code
var js = $('<script />',
{
src : 'scripts/contentStrings/content.js',
type : 'text/javascript',
language : 'javascript'
})
js.appendTo(head) <-- the error from
If I check on header the script is append to header.
Any help is much appreciated.
Edited :
Here is the inside of content.js
var sponsor = {}
sponsor[containerSize] = [[78,60] , 60 , [7,17.3] , [19,16]];
sponsor[imageBackground] = [[78,60] , 60 , [7,17.3] , [19,16]];
sponsor[contentLong] = <div id='contentGroup'>Long content</div>;
sponsor[contentShort] = <article style='font-size:10px !important'>Some short article</article>;
More From » jquery