Bitcoin Forum
May 25, 2024, 03:51:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Project Development / Help With Code For Live Btc values on: March 22, 2014, 03:37:30 PM
Hi, i'm new here.

I have some code that i am trying to get working to display live prices in various currency on a site i am working on as a bit of a hobby as btc interests me and im planning on buying some soon.

The codes i have inserted into the site are as follows.

This goes in the wordpress header =

<script src="js/jquery-1.10.2.min.js"></script>

This goes in the body of the wordpress page  =


 <script>
        $( ".currencySwitch" ).click(function( event ) {
            $( ".currencySwitch" ).removeClass( "active" );
            $( this ).addClass( "active" );
            event.preventDefault();
            var countryCode = $( this ).data( "code" );
            $.ajax({
                type: 'POST',
                url: 'ajax.php',
                data: { country: countryCode },
                dataType: 'json',
            beforeSend: function() {
                    $( "#price" ).html( "<div class=\"loading\"></div>" );
            },
                success: function (data) {
                    window.history.pushState( "Updating URL", countryCode, "/?currency=" + countryCode );
                    $( "#price" ).fadeOut(function() {
                 $( this ).text( data.price ).fadeIn( "fast" );
               });
                }
            });
        });
        </script>

I get lost from there on. You can see what it is trying to function here http://www.currentpriceofbitcoin.co.uk/btc-news. I guess what i really need is the code to draw from a price source.

Any help would be appreciated.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!