Monday 7 October 2019

JavaScript: How can I get data for the function from the URL?

I started learning JS 2 days ago.
I downloaded an algebra calculator and inserted it into my webpage. Here is the full code:


















The script returns prime factors of 3+3 or 6 (var textToBeExecuted = 'factor(3+3)'), but what I need is to evaluate expressions taken from the URL (example: /?input=3%B54 means 3+4 and returns 7). How can I do this? Please help!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...