Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.36 KB | None | 0 0
  1. function getUrlParams( prop ) { var params = {}; var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) ); var definitions = search.split( '&' ); definitions.forEach( function( val, key ) { var parts = val.split( '=', 2 ); params[ parts[ 0 ] ] = parts[ 1 ]; } ); return ( prop && prop in params ) ? params[ prop ] : params; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement