There are 2 issues here.
First is the multiple domain bit - can't use Ajax - it's single domain. iFrames will work, and images (my personal choice) will work but...
Second problem: IE particularly will stop loading things and resources the moment it notices that it is leaving the current page.
IE., as soon as you say top/document.location, will abandon any loading operation - it will even stop animating GIFs. This would not be a problem, except that inline code in the header is going to go really fast, and it is a sure bet that the JS will get to the change in location line before it has fired off the thread to go get <the whatever that is your beacon>. The real problem here is that Javascript does not offer a blocking Sleep-like function. The only way to delay execution in JS is to either set a timeout or an interval. One other technique is to not count on a delay, but rather to count on a completion ie., when something is all done. The problem here, is that your page will have loaded before the timeout/event pops. There are a couple ways to obscure the PERCEPTION of the page loading... we can handle that in a bit ...
but assuming that we do, here's my suggestion for the dandelion (my personal nom-de-technique for little uni-directional snippets of information blowing towards my server from the client):
I'm thinking you need to create an image and load it inline:
myImage = new Image();
myImage.onLoad = function() { top.location = '
http://anotherdomain.com'; }
myImage.src = '
http://nopsDomain.com/aURL.php?parm1=this&parm2=that';// obviously, where the url above is a string construct of the data you want to pass...
this, put in the header, will fire off an immediate request for a graphic - in fact, since it is in the header it will be before any other requests for graphics have fired off. It will be very fast, BUT the browser will have gotten and started to render your HTML before it arrives. Note that I think you should have a 1x1 pixel .GIF that you return to absolutely maximize the speed at which you will respond to the event. I like this method because it will move as quickly as possible, regardless of connection or machine speed.
Now... what's the problem with cloaking/hiding/obscurring the page content? Why can't we do a little JS and obscure the opening of the page?
/p