MediaWiki:Resources/landingpage.js: Difference between revisions

Content deleted Content added
Pgehres (WMF) (talk | contribs)
No edit summary
Pgehres (WMF) (talk | contribs)
No edit summary
Line 14:
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];
Line 92:
}
}
});
$(document).ready(function(){
var otherVal = getQuerystring( 'otherVal' );
if( otherVal == '' || isNaN( parseFloat( otherVal ) ) ){
return;
}
otherVal = parseFloat( otherVal );
 
$("#input_amount_other").attr( 'checked', true );
$("#input_amount_other_box").val( otherVal );
});
</script>