Skip to content

Instantly share code, notes, and snippets.

@sampel
Created December 11, 2012 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sampel/4256884 to your computer and use it in GitHub Desktop.
Save sampel/4256884 to your computer and use it in GitHub Desktop.
Piece of javascript code: gets the service parameter rom the url (GET) and check if contains something
/*********************************/
/* by Sampel */
/* */
/* When users come to my portal */
/* if they come to login, then */
/* show the login. The only way */
/* know if the user comes to log */
/* in is with the get parameter */
/* service */
/*********************************/
$(function() {
function getURLParameter(name) {
return decodeURI( (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] );
}
if (getURLParameter("service").indexOf("spring_cas_security_check") > -1) {
toogleLoginModal();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment