I require the expertise of an experienced coder for a moment to help solve this issue that I am unable to solve as my skill and knowledge is basic at this current time.
Below is a script that I use in conjunction with a page creation service that in a nutshell will pass email address data from one web form on Page A and pass the email address on to a web form on Page B.
<script>
var queryDict = {};
location.search.substr(1).split("&").forEach(function(item) {
queryDict[item.split("=")[0]] = item.split("=")[1];
});
var dest = "http://google.com"; // <==== Second Squeeze Page URL Here;
if (queryDict.email === undefined) {
var redirectURL = dest;
} else {
var redirectURL = dest + "?email=" + queryDict.email;
}
document.location = redirectURL;
</script>
I have a seperate script that detects if a user is on Chrome and redirects to URL XYZ:
<script type="text/javascript">
if (navigator.userAgent.indexOf('Chrome') !=-1)
{
// Using Chrome
window.location = "http://hotmail.com"
}
</script>
I have tried on my own to combine and attempt to write new code adding on to script #1 to no avail as it is beyond my knowledge capacity at this current time.
I am unsure of how I can combine the two together so I have a script that works as intended as described below.
I would like for this script to now also detect Chrome browser users and if user "is" a Chrome user, the script is to then redirect Chrome users to XYZ URL where 'XYZ' is a destination URL I specify but at the same time still pass email address data on to a web form that will be on 'XYZ' URL whilst all other browser users will be redirect to the default URL specified in code #1, in this instance, would be 'http://google.com'.
I am very Novice with this, again, I am sure this is an easy fix for any experienced coder, I'm still learning.
Thank you in advance your help community, I look forward to receiving a solution and learning and acquiring a better understanding in the process.