Page 1 of 1

more sophisticated code

Posted: Sat Nov 01, 2014 5:48 pm
by Vegan
Been working with XML a bit more and I found something that might have some potential

Code: Select all

    // http://www.amazon.com/dp/YOUR10DIGITASIN
    var xmlhttp = new XMLHttpRequest();
    var url = "http://www.amazon.com/dp/" + AISN
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange=function() {
	    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			temp = '<iframe src="http://rcm-na.amazon-adsystem.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=';
			temp += AISN;
			temp += '" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
			document.write(temp+='\n');
	    }
	}
this the right idea?

Re: more sophisticated code

Posted: Sun Nov 02, 2014 9:57 am
by Celauran
It's unclear what specifically you're trying to accomplish, so it makes it hard to say whether or not that's the right idea. Two things immediately come to mind, though. 1. That's an awful lot of hardcoded values. 2. XML? Really? Is JSON not available?

Re: more sophisticated code

Posted: Wed Nov 05, 2014 1:10 pm
by Vegan
I was wanting to check to see that a given product is still in the catalog before showing an ad

Re: more sophisticated code

Posted: Wed Nov 05, 2014 4:39 pm
by Benjamin
I would focus more on getting click throughs so your referral cookie is set; because it doesn't matter what they buy, you'll get a kickback.

Re: more sophisticated code

Posted: Wed Nov 05, 2014 5:41 pm
by Vegan
I am also experimenting with some other ad ideas, when in doubt add more code