function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
So you can use:
myvar = getURLParameter('myvar');
More Related Contents:
- How can I write a function that will format a camel cased string to have spaces?
- How to Protect website code PHP / JS? [closed]
- How to decode HTML entities using jQuery?
- What is the difference between a User and a GuildMember in discord.js?
- I know that callback function runs asynchronously, but why?
- How do I remove all null and empty string values from an object? [duplicate]
- Adding a new array element to a JSON object
- How do I convert special UTF-8 chars to their iso-8859-1 equivalent using javascript?
- Intercept a form submit in JavaScript and prevent normal submission
- require is not defined? Node.js
- Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai
- How can I return multiple lines JSX in another return statement in React?
- How to read a local text file in the browser?
- get a list of all folders in directory [closed]
- Using javascript and jquery, to populate related select boxes with array structure
- How do you find out the caller function in JavaScript when use strict is enabled?
- RegEx: How can I match all numbers greater than 49?
- How to save data from a form with HTML5 Local Storage?
- Submit form after calling e.preventDefault()
- When should I use delete vs setting elements to null in JavaScript? [duplicate]
- Age from Date of Birth using JQuery
- Rendering an array.map() in React
- How to change date format in JavaScript [duplicate]
- How can I open a link in the default web browser from an HTA?
- Submit jQuery UI dialog on
- Programmatically creating an SVG image element with javascript
- Synchronous XMLHttpRequest on the main thread is deprecated
- jQuery: noConflict
- Is there any size limitation for ajax post?
- Internet Explorer full screen mode?