Рет қаралды 20,432
Full Article: mrvirk.com/get...
What is Query String ? mrvirk.com/wha...
Related Video: • Programmatically passi... (Programmatically passing URL Parameters to IFrame src using JavaScript)
We will learn How to get URL Parameter values ?geo=UK&size=300×600 in Javascript ?
This is the most latest and safe solution you can find in 2019.
How to approach the problem ?
We will solve the problem using URL Object, which is basically getting the url of the page when it loads, then passing it though the URL object, like this
var url = new URL(“mrvirk.com?geo=UK&size=300×600”);
Solution Code in Javascript
Follow the code below on Codepen and insert the parameter in codepen url to see results in console.
Link to Code: codepen.io/vir...