Get url parameter and hashed value from an url in javascript : I have a url `http://local.evibe-dash.in/tickets/123?ref=avl-error#10610`

I want to get ref=avl-error and 10610 in two variable

  for Example somthing like that 

    var1 = 'avl-error';
    var2 = 10610;

How can I get it in javascript or jQuery
   