We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36992
    • 3 Posts
    Help me, please.
    how to integrate this script http://www.techmug.com/ajax-currency-converter-with-google-api/ - AJAX Currency Converter with Google API?
    MODX Revo [ed. note: alualu last edited this post 15 years ago.]
      • 32316
      • 387 Posts
      whistlemaker Reply #2, 15 years ago
      • the php from ajax_converter.php would go into a snippet
      • create a basic page (resource) and call the snippet
      • save the javascript to a file
      • create a 2nd snippet to link/include jQuery and the js file you created into a resource
      • take the display html and create a chunk - change the ajax call to whatever will call the resource you created above, and call the 2nd snippet that will include the javascript.
      • add the chunk to any resource where you want the converter to appear

      That's it.
      There are other ways to do it - I can think of a couple and I'm sure others would do it differently.
      Have fun!

      Note to other readers - if you follow the OP's link and download the zip you will get two files - an index.php which has some html and js, and ajax_converter.php which is a php file that takes some POST data and returns the results (via an ajax call)
        • 36992
        • 3 Posts
        Thank you, whistlemaker, I will try