Showing posts with label Params. Show all posts
Showing posts with label Params. Show all posts

Wednesday, November 16, 2016

jQuery get params from url

var params = {};
window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str, key, value) {
    params[key] = decodeURIComponent(value.replace(/\+/g, ' '));
});
console.log(params);

Tuesday, November 8, 2016

Grails get retrieve GrailsParameterMap params from service class or util class

Have to import:
import org.springframework.web.context.request.RequestContextHolder

and use following:
def params = RequestContextHolder.getRequestAttributes().params