Common Computer Science References
At the end of this lesson, you will be able to:
understand and use query strings
what is a URL
how do you pass in information into a webpage?
through the URL, query strings
https://www.google.com/search?q=MTHS
what is that stuff starting with the "?"
see example below: http://10.100.204.80/~mr-coxall/ICD2O/Unit6/Unit6-04/?aBase=1&bBase=5&height=6
more importantly, how do you get the information out in JS?
const params = new URLSearchParams(document.location.search)
const hours = params.get('height')
you will have to place it in the windows.onload function, else the JS code will run before the HTML is loaded!
window.onload = function() { ...
create a web page that will do the following:
calculates the volume of a sphere
use a query string to accept the radius
now create 3 test cases for this problem
do the above program in PHP (hint it is already done for you!)