Получить переменные URL - CSS-хитрости

Anonim
function getQueryVariable(variable) ( var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i 

Usage

Example URL:
http://www.example.com/index.php?id=1&image=awesome.jpg.webp

Calling getQueryVariable("id") - would return “1”.
Calling getQueryVariable("image") - would return “awesome.jpg.webp”.