MediaWiki:Resources/landingpage.js: Difference between revisions

Content deleted Content added
Pgehres (WMF) (talk | contribs)
creating page with JS from Template:Lp-layout-default
 
Pgehres (WMF) (talk | contribs)
adding getQuerystring function from Template:2012FR/Form-template-whereyourdonation
Line 8:
} );
} );
 
function getQuerystring( key ) {
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' );
var qs = regex.exec( window.location.search );
return qs == null ? '' : qs[1];
}
 
</script>
</html>