Hey Guys, So I use aweber for my email lists and I got some javascript code from them to pass the personalized options of the subscriber onto a webpage. The javascript looks like this. Code: <script type="text/javascript"> var formData = function() { var query_string = (location.search) ? ((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : ''; var elements = []; if(query_string) { var pairs = query_string.split("&"); for(i in pairs) { if (typeof pairs[i] == 'string') { var tmp = pairs[i].split("="); elements[unescape(tmp[0])] = unescape(tmp[1]); } } } return { display: function(key) { if(elements[key]) { document.write(elements[key]); } else { document.write("<!--If desired, replace everything between these quotes with a default in case there is no data in the query string.-->"); } } } }(); </script> So I want to display the url of the download page they need to go to in order to get the product. I want them all on one list so I am associating the url of the download page as a custom field on the sign up form. Like this: Code: <input type="hidden" name="custom downloadurl" value="http://letsdownloadstuff.com" /> So if they signed up under my ficticious dog product sign up form it would look like this: Code: <input type="hidden" name="custom downloadurl" value="http://letsdownloaddogstuff.com" /> So the download url is changing according to what sign up for they sign up under. Then when they confirm their subscription they are taken to a page were they find their download link. I then ( according to aweber ) put the above javascript code in the <head> and this code were I want the custom field to appear Code: <script type="text/javascript">formData.display("custom downloadurl")</script> Then on my download page it says something like, thanks for purchasing the product go to this page and get your product:
javascript formdata.display into a link
2
Hey Guys,
So I use aweber for my email lists and I got some javascript code from them to pass the personalized options of the subscriber onto a webpage. The javascript looks like this. So I want to display the url of the download page they need to go to in order to get the product. I want them all on one list so I am associating the url of the download page as a custom field on the sign up form. Like this: So if they signed up under my ficticious dog product sign up form it would look like this: So the download url is changing according to what sign up for they sign up under.
Then when they confirm their subscription they are taken to a page were they find their download link. I then ( according to aweber ) put the above javascript code in the <head> and this code were I want the custom field to appear Then on my download page it says something like, thanks for purchasing the product go to this page and get your product:
http://letsdownloadstuff.com
So depending on the signup for they signup on the download url will change. Is this making sense?
The main deal is I want to know how to make the download url into a link that when they click on it, it takes them to the download url specific to whatever sign up form they signed up under. Cause right now it is just plain text in my firefox browser.
I am sure I'm going to have to clarify things but I appreciate any help you can give me.
by the way the urls given are just examples and are not my sites.
So I use aweber for my email lists and I got some javascript code from them to pass the personalized options of the subscriber onto a webpage. The javascript looks like this.
Code:
<script type="text/javascript">
var formData = function() {
var query_string = (location.search) ? ((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : '';
var elements = [];
if(query_string) {
var pairs = query_string.split("&");
for(i in pairs) {
if (typeof pairs[i] == 'string') {
var tmp = pairs[i].split("=");
elements[unescape(tmp[0])] = unescape(tmp[1]);
}
}
}
return {
display: function(key) {
if(elements[key]) {
document.write(elements[key]);
} else {
document.write("<!--If desired, replace everything between these quotes with a default in case there is no data in the query string.-->");
}
}
}
}();
</script> Code:
<input type="hidden" name="custom downloadurl" value="http://letsdownloadstuff.com" />
Code:
<input type="hidden" name="custom downloadurl" value="http://letsdownloaddogstuff.com" />
Then when they confirm their subscription they are taken to a page were they find their download link. I then ( according to aweber ) put the above javascript code in the <head> and this code were I want the custom field to appear
Code:
<script type="text/javascript">formData.display("custom downloadurl")</script> http://letsdownloadstuff.com
So depending on the signup for they signup on the download url will change. Is this making sense?
The main deal is I want to know how to make the download url into a link that when they click on it, it takes them to the download url specific to whatever sign up form they signed up under. Cause right now it is just plain text in my firefox browser.
I am sure I'm going to have to clarify things but I appreciate any help you can give me.
by the way the urls given are just examples and are not my sites.
- Mark Crawford
Next Topics on Trending Feed
-
2