- home ›
- methods ›
- querystring
- Dom
- click
- inArray
- merge objects
- query string
- smartcheck
- attr
- addClass
- hasClass
- removeClass
- append
- prepend
- remove
- has
- findAll
- empty
- position
- offset
- outerWidth
- outerHeight
- replaceWith
- html
- text
- val
- parseHTML
- parseJSON
- parent
- next
- prev
- first
- last
- now
- toArray
- size
- Manipulation
- dates compare
- getMonthName
- getDayName
- .NET JSON date
- hashtag
- number Format
- pad
- smallCase
- upperCase
- Forms
- focus
- mobile number
- repetition
- placeholder
- Browser
- browser feature
- Browser Information
- Effects
- hide
- show
- sticky
- scrolline
- goUp
- Animation
- circles
- Google analytics
- Google fonts
.querystring()
Description: Fetch a query string value and all parameters from URL.
Example:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>querystring example</title>
<script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
</head>
<body>
<strong>Single Query String</strong>
<p class="querystring"></p>
<strong>All Query Strings</strong>
<p class="querystring-object"></p>
<script>
//FETCH SINGLE KEY VALUE
bitsyCode( ".querystring" ).html( bitsyCode.querystring("plugin") );
//FETCH ALL KEYS AND VALUES
var object = "";
var result = bitsyCode.querystring({ all:true });
for (var key in result) {
object += " "+key + " = " + result[key] + "<br />";
}
bitsyCode( ".querystring-object" ).html("{<br />" + object + "}");
</script>
</body>
</html>
Preview:
Single Query String
All Query Strings
BitsyCode
All Query Strings
{
plugin: BitsyCode,
version: 1.0
}
Share