Method 1 Remove the line breaks, making the entire string a single line
var lines = '<div id="jwplayer"><center>...</center></div>';
document.write(lines);
Method 2 Escape the line breaks with backslashes.
var lines = '<div id="jwplayer">\
<center>\
...\
</center>\
</div>';
document.write(lines);
Method 3: Concatenate the string a line at a time
var lines = '<div id="jwplayer">';
lines += '<center>';
lines += '...';
lines += '</center>';
lines += '</div>';
document.write(lines);
Method 4 : Create an array strings and join them
var lines = [
'<div id="jwplayer">',
'<center>',
'...',
'</center>',
'</div>'].join(' ');
document.write(lines);
Source : Javascript document.write('HTML CODE HERE') and using a var grabbed by flash