Skip to content

Instantly share code, notes, and snippets.

@mhmohon
Created December 16, 2019 11:03
Show Gist options
  • Save mhmohon/1ea28b4a8df84b97fed0268a17e490f4 to your computer and use it in GitHub Desktop.
Save mhmohon/1ea28b4a8df84b97fed0268a17e490f4 to your computer and use it in GitHub Desktop.
Get url prams
//URLSearchParams() JQuery built in function.
// e.g. http://127.0.0.1:8000/account?option=user_registration
//window.location.search will get search keyword. (?option=user_registration)
let searchParams = new URLSearchParams(window.location.search);
if(searchParams.has('option'))
{
let param = searchParams.get('option');
if(param == 'user_registration')
{
if($("#edit").length != 0)
{
$('#edit').click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment