parse query in js and use places in header