I am trying to pass a bunch of variables to a hidden input value but I am getting a stupid syntax error in this code:
$('#imgdata').append(
'<input type="hidden" name="imgdata[' + id + '][width]" value="' + _width + '"/>
<input type="hidden" name="imgdata[' + id + '][height]" value="' + _height + '" />
<input type="hidden" name="imgdata[' + id + '][left]" value="' + _left + '" />
<input type="hidden" name="imgdata[' + id + '][top]" value="' + _top + '" />
<input type="hidden" name="imgdata[' + id + '][src]" value="' + _src + '" />'
);
I must be overlooking a simple syntax mistake. Console tells me its in 3rd line.
SOLUTION:
The issue was with the line-wrapping. Making the code inline without pressing enter for formatting fixed it.
' +and begin 3,4,5, and 6 with a'as not every editor can handle line-wrapping seamlessly.Uncaught SyntaxError: Unexpected token =in line 3 while safari saysSyntaxError: Unexpected EOF