Bitcoin Forum
November 23, 2017, 05:29:46 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: blockchain.info receive payments javascript buttons and IE  (Read 670 times)
twmz
Hero Member
*****
Offline Offline

Activity: 673



View Profile
April 09, 2013, 12:35:03 AM
 #1

The blockchain.info payment buttons (http://blockchain.info/api/api_receive) are pretty sweet.  I am using them to accept donations on a free web app I run, but I ran into the fact that the buttons, as written, don't work in IE 8 and IE 9.  Now, in theory, I could have just decided to not care, but I hate to turn away the rare person who wants to give me a donation just because they might happen to be on an old crappy browser.

The issue appears to be that the pay-now-button.js code is making a cross domain ajax call using jQuery, but jQuery does not support CORS in Internet Explorer.

I fixed this for my website by using the jQuery plugin below.  Note, it works for IE8+ only, which is good enough for my app.  Also note, this only fixes the problem for web apps using SSL because IE refuses to do CORS to an SSL endpoint unless the host page is also SSL.

Plugin:  https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest/blob/8754607e5f9ab73ccc37246f0c12fed14f85bd28/jQuery.XDomainRequest.js
SSL restriction: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx

You might want to either recommend this plugin, or better yet change the pay-now-button.js code and API to support/use JSONP instead of CORS.

Was I helpful?  1TwmzX1wBxNF2qtAJRhdKmi2WyLZ5VHRs
WoT, GPG

Bitrated user: ewal.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!