0

I need some help to pass parameter value from browser url and change url also on page change

For reference, it is just like google search when you search any word in google as 'search'

and url becomes https://www.google.co.in/#q=search.

I need exactly same without refreshing page.

Please help me and thanks in advance.

3
  • Are you trying to change the url of your current page or you want to call the page from your ajax call? Commented Apr 21, 2014 at 6:22
  • see tech-blog.maddyzone.com/javascript/… for more deatils Commented Apr 21, 2014 at 6:23
  • I have to display search result on same page like google Commented Apr 21, 2014 at 6:29

2 Answers 2

1

You cannot change the entire url without redirecting or 'refreshing' the page. The bit in the url following the '#' symbol is intended to direct the browser to different parts of the document. You can change this in jQuery using

document.location.hash = "foo";
Sign up to request clarification or add additional context in comments.

1 Comment

Can you say how to pass parameter value and display results from database?
0
$.ajax({
   type: "POST",
   url: "analytic.php",
   data:{cmt:comment,alert_id:alertid}
});

This code send the data on another page and get result from that page without refreshing the page.But in this url remains same.

1 Comment

But I need functionality exactly like google search and pass parameter value through browser url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.