in my html page within the head tags I have below js.
document.write('<img src="http://www.foo.com?Email='+Email1+'&Address 1='+A11+'&Address 2='+A21+'&Birthdate='+DOB1+'&City='+CI1+'&First Name='+FirstName1+'&Gender1='+Gender+'&Last Name='+LastName1+'&Phone Number='+PH1+'&State='+ST1+'&Zip Code='+ZIP1+'" width="1" height="1">');
setTimeout("location.href = 'http://www.foo.com?rid=" + (rid+FirstName+LastName+Email+Gender+DOB) + "&r="+(vRURL+A1+A2+CI+ST+ZIP+PH)+" ';",1500);
when I run the above in IE it redirects to whatever I have set in the setTimeout function, but on mozz it does not redirect. Mozz just get's stuck with the document.write in transferring data from foo.com back to me, but i only want it to do a document.write then move to setTimeout function.
I have struggling to get this working. anyone any ideas please?
Try using encodeURIComponent() on URL parameters. Like this: ...?Email='+encodeURIComponent(Email1)+'&Addr...
Also add / before ? to make a valid URL (though I'm not sure about this).
Dude thanks for your reply. That though wont solve it. The issue is such that on mozz it does the document.write, but it hangs and does not move on to setTimeout.
Is it even valid for an image to be written to the head?
I have had this solved now.
A typical way is for you to use a redirect page. That way, the redirect page performs the update that you require, and you can pass to that redirect page the name of the page that you want to redirect to, which can contain querystring info encoded within it as well.
Are you speaking of pushing the data to a popup window?
No, I'm speaking of using server-side code to do your action and to then perform the redirect for you.
If you don't want to go that far, you can just make use use of an ajax request of the first location, before loading the second page.
had I had access to the server side code this would been bread and butter to do, but I don't; I only have access to the client-side of things.
would you please care to show me how it is done using Ajax? I have been looking at an Ajax solution but could not get it to work.
Sure, the [Bulletproof Ajax book has good [url="http://bulletproofajax.com/code/"]code and examples](http://bulletproofajax.com/) to go along with the book's content.