I have the following code that our users will use to embed a widget on their page:
var ttp_number = "1Z123489754897";
var ttp_key = "1234567890123457890123";
var ttp_width = 850;
var ttp_height = 650;
var ttp_m_width = 260;
var ttp_m_height = 200;
(function(){
document.write('<div id="ttp"></div>');
s=document.createElement('script');
s.type="text/javascript";
s.src="//example.com/embed.js";
setTimeout("document.getElementById('ttp').appendChild(s);",1);
})();
Is there a way to reorganize or make this more compact (other than minifying)?
Right now the big list of variables feels inefficient just declaring them one at a time, but not sure what the alternate would be?
NOTE: I need to keep the script as compact as possible as the people who are copy/pasting this code many times know very little (if any) javascript, so if they some massive block of code, they'll freak out or stand a bigger chance of screwing it up.