Reputation: 11
I'm working on a simple Javascript app, and I need a way to take a string an determine a value by entering it into a calculator. (i.e. if the string is "pi^2 sqrt(3)" you'll get 17.0946563")
Rather than reinventing the wheel, I was hoping there was a way to implement Google's calculator to grab the result. Basically, I want to call http://www.google.com/ig/calculator?hl=en&q= followed by the string, and have Google output the result. The only example I've seen is the one here but it's in PHP. I don't know much PHP, so I was wondering if there was any way to either call the PHP function from within Javascript or implement the function directly with Javascript. Thanks in advance for any advice.
Upvotes: 1
Views: 550