Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: litehacker on February 17, 2013, 09:50:56 PM



Title: Javascript currency conversion tool for Bitcoin merchants
Post by: litehacker on February 17, 2013, 09:50:56 PM
Hello everyone,

I recently added BitPay as a payment option to my website.
However I didn't have the ability to easily convert all of my USD prices to Bitcoin automatically.

As a result, I've now built a multiple currency, auto detecting, library which allows you to easily convert your prices to Bitcoin to display to the user quickly.
You can check it out here:
http://www.veniaminilmer.com/jsbitconv


Title: Re: Javascript currency conversion tool for Bitcoin merchants
Post by: franky1 on February 17, 2013, 11:48:29 PM
edit: original comment no longer required. seems he has now got thngs sorted


Title: Re: Javascript currency conversion tool for Bitcoin merchants
Post by: litehacker on February 18, 2013, 12:02:22 AM
javascript itself doesn like pulling webcontent from remote servers (price ticker api's). the closest you can get simply is by researching AJAX

http://w3schools.com/ajax/ajax_example.asp (http://w3schools.com/ajax/ajax_example.asp)

I am not pulling remote server content with javascript. That is against the same origin policy. Plus if it were to keep pinging the bitcoincharts API every time someone views a merchant page, bitcoincharts wouldn't be very happy.

The conversion rates are cached. Makes the javascript calls much faster.