In a SharePoint 2013 publishing site, I have a custom search page.
This page can be reach from the search box in the master page. It lands on : http://server/pages/search.aspx?k=myquery, which is expected.
In this page, I have a search zone, and a result webpart. If I type a new search from this page, I land on: http://server/pages/search.aspx?k=myquery#k=mynewquery.
Is there any way to get the current query from a javascript code?
Actually, I have a custom webpart that requires to get this query. My current webpart (inherited from SP2010) relies on the query string from C# code, but this does not work with SP 2013 due to this new pure ajax page update.
Thanks for advise.
PS: my alternative would be to parse the url (looking for the k query string first after the #, then in the url query).
myquery