Tweak: New Format of Buy Button Code

My favorite type of post again! I really like to write about new features, tweaks and changes in Click2Sell system, so I’m glad to write this one. This time I’ll tell you about one of our most recent tweaks in the system: modified buy button’s code.

We changed the code a bit: split some areas of it and rearranged them. The older one looked like this:

[script type="text/javascript" src="http://www.click2sell.eu/js/buy_now_butt.js"> [script type="text/javascript" >[!– generateBuyNowButton("https://www.click2sell.eu/buy?testerespa", "http://www.click2sell.eu/images/paynow_v3_5.png","www.click2sell.eu","3692"); –>

Here is an example of new button’s code:

<a id="c2s_bn_lnk_5192" href="https://www.click2sell.eu/buy?testerecha"> <img src="http://www.click2sell.eu/images/paynow_v3_5.png" border="0" title="Buy now!" alt="Buy now!"> </a>

<script type="text/javascript" src="http://www.click2sell.eu/js/buy_now_butt_v2.js"></script>
<script type="text/javascript"> c2s_bn_initializeBuyNowLink(‘www.click2sell.eu’, ‘5192’);</script>
 

See the difference?

Yes, yes, I hear some of you asking "so what? what’s the point of wasting time on such little thing?". Let me answer this question. The main benefit of this change is that the buy button will be shown even then when Javascripts are disabled. That’s where the old button’s code failed as it was entirely wrapped in Javascript "clothes".

The other important aspect is somewhat easier reading of button’s code. Now the visible side of button is clearly separated from Javascript code and is put into common HTML tags that most of you know. You can clearly see what is responsible for what in non-java part of the button’s code, so you can edit it knowing just basics of HTML language.

What happens to buttons or links of old format that are already put into webpages or sales-pages? Nothing. They will keep working without any problem. Although we don’t provide old format code anymore, however they will keep working if you already have put some of old buttons to your website. Internal working principle of old and new button’s codes are identical.

It’s up to you if you want to update your current buy buttons to the new format codes or keep the old ones. Just keep in mind that the number of people who browse in the internet with scripts disabled is growing.

Popular Posts:


Similar Posts:

Leave a Comment