How can I get currency converter Google html code?
How can I get currency converter google html code to help build a new currency converter and what are the restrictions for such intended use of the code?
How can I get currency converter google html code to help build a new currency converter and what are the restrictions for such intended use of the code?
Hi,
Google provide API for currency converter. You will have to dived the code in to three components
1. HTML
2. AJAX
3. PHP
1. Html consists of one textbox, two dropdown lists and a button. By clicking the button the data is displayed in label.
2. On click paste the code behind the button for conversion
$(document).ready(function() {
Â
 $('#convert').click(function(){
Â
 //Get all the values
 varamount = $('#amount').val();
 varfrom = $('#fromCurrency').val();
 varto = $('#toCurrency').val();
Â
 //Make data string
 vardataString = "amount="+ amount + "&from="+ from + "&to="+ to;
Â
 $.ajax({
 type: "POST",
 url: "ajax_converter.php",
 data: dataString,
Â
 success: function(data){
 //Show results div
 $('#results').show();
Â
 //Put received response into result div
 $('#results').html(data);
 }
Â
 });
 });
});
Â
3. Now fetch the value in the script and display them by using php. Kindly use these functions in your code and you will get the results.
a)Â Â Function file_get_contents
b)  Function explode Click here to switch to the beta php.net site
c)  Function round Click here to switch to the beta php.net site
d)  Function ucwords Click here to switch to the beta php.net site
Â
You can add the below HTML code to your website with correct dimensions. This gadget does the calculation through Google API and the gadget itself provided by Google. You can see its functions by pasting the below code into a notepad and save it as a HTML file. Then double click the HTML file and you’ll see the gadget working.
<!–script parameters: design=true|false : designed or simple component | width=180 : set the width of your tool (not for designed mode)–><a href='https://en.swissquote.com/forex' id='ACMLink'>Forex</a> <script language='javascript' src='http://www.tradingtoolsonline.com/converter-script.aspx?design=false' type='text/javascript'></script>
You can find more information about the above gadget and other available Google gadgets from below link.