Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged url



« Prev 1 2
Function enables the reading of url appended variables. See URL for more information.
0 97 posted 6 years ago by gromitski
Works in SP2013 (and I believe 2010). Provides site collection URL without trailing "/"
0 84 posted 6 years ago by rumremix
This snippets show how to extract the video id of a youtube video from its URL
0 134 posted 7 years ago by slimITTN
Code from https://snipt.net/geekyjohn/get-url-param/ updated so that most jslint issues are resolved, and updated the return to use a guard condition instead of a separate if statement.
1 150 posted 7 years ago by pmw57
//You cannot change the whole url without redirecting, what you can do instead is change the hash. //The hash is the part of the url that goes after the # symbol. //That was initially intended to direct you (locally) to sections of your HTML doc...
0 98 posted 7 years ago by dnnsldr
This will return the value of "param" form the URI. For example if you have www.example.com/index.html?param=some_value it will return "some_value". NOTE! This only works if you use Prototype JavaScript framework.
0 100 posted 8 years ago by srka
usage : var author_value = getQuerystring('author');
0 97 posted 8 years ago by nickaranz
(I did not write this, but I forgot where I got it.) This code will find all the variables passed though the URL and return the one you are looking for.
0 64 posted 8 years ago by sicbot
I found some cases where JavaScript won't properly handle the Plus symbol (+)
0 73 posted 8 years ago by Jamie
Usage: Let's say we have an url: http://primera.vremenno.net?foo=yes&bar=no var hash = getUrlVars(); alert(hash['foo']); // returns 'yes' alert(hash['bar']); // returns 'no'
0 105 posted 8 years ago by a1ias
0 97 posted 9 years ago by dubogii
given a url: >`http://www.someurl.com/page.html?param1=foo&param2=bar` You can use map.param1 outside of the function such as: >`$('#some_hidden_field').val(map.param1);`
0 53 posted 9 years ago by agdm
Modified regex of URL Matcher found on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
0 64 posted 9 years ago by naren1012
Hopefully this covers just about everything. This code has far more lines than htmlify.js but seems to work ok. (I just remembered that " // Loop through the clear text " has no loop breaker - will post a fix, but it's not a show-stopper for mo...
0 121 posted 9 years ago by jm1248
* example: google.com/reader/view/ folder = /reader * example: google.com/reader folder = / * example: google.com folder = ''
0 122 posted 9 years ago by markux
I did not, in fact write this script. I found it here: http://www.webtoolkit.info/javascript-url-decode-encode.html
0 65 posted 9 years ago by racl101
0 98 posted 9 years ago by shinya
0 69 posted 9 years ago by mmstudio
checks who tagged a given url on delicious
0 43 posted 10 years ago by magicrebirth
1 154 posted 10 years ago by ozke
A short photo id is a base58 conversion of the photo id. Base58 is like base62 [0-9a-zA-Z] with some characters removed to make it less confusing when printed. (namely 0, O, I, and l). So that leaves an alphabet of: 123456789abcdefghijkmnopqrstuvw...
0 66 posted 10 years ago by loucypher
Read a page's GET URL variables and return them as an "associative array." Calling the function while at `example.html?foo=asdf&bar=jkls` sets `map['foo']='asdf'` and `map['bar']='jkls'`
17 444 posted 10 years ago by the_coder
0 89 posted 10 years ago by enchance
« Prev 1 2