It will look like this:
function download(elm) {
$("<iframe />", { src: "GenerateFile.aspx?" + elm.innerHTML })
.appendTo("body").hide();
}
This is jQuery 1.4+ syntax $(html, props), for older versions it will look like this:
function download(elm) {
$("<iframe />").attr("src","GenerateFile.aspx?" + elm.innerHTML)
.appendTo("body").hide();
}
A past creation .appendTo()adds the element you created to the passed selector ( "body") and .hide()embraces the style display: none;.
source
share