Embedding a widget to a page
Don't make your code more compact, it's a futile exercise. Use a minifier or even a compiler/optimizer. Your source code should be as readable as possible
document.write is evil, don't use it.


Here's how I would write it:

var tpp = {
    number: "1Z123489754897",
    key: "1234567890123457890123",
    width: 850,
    height: 200,
    "m width": 260,
    "m height": 200
};

function init(settings) {
    var div, script;
    div = document.createElement("div");
    div.id = "ttp";
    document.body.appendChild(div);
    script = document.createElement("script");
    script.src = "//example.com/embed.js";
    script.type = "text/javascript";
    document.body.appendChild(script);
}

window.attachEvent("load", function() {
    init(tpp);
});
/* or */
window.addEventListener("load", function() {
    init(tpp);
});



Adding the event listener on window.load avoids having to do the setTimeout later on.
Also, when doing a setTimeout, don't use the eval variant, use an anonymous function:




setTimeout(function () {
    document.getElementById('ttp').appendChild(s);
}, 1);