Hi All,

I am new to Ajax. I have updated my website with Ajax code. How should I get unique url after click on menu. I mean if I click on "about me" on my website yogawithgauri.com. the url in the address bar should be yogawithgauri.com/aboutme

Please let me know how I can do this

Thanks & Regards

7 Years
Discussion Span
Last Post by Protuberance

thanks for quick reply...its so simple. But then how will i display the content on the same page after clicking on the menu

Edited by gauri_agr: n/a


You need to make your navigation menu without ajax.
Each navigation method on the server must render whole page, not just block content.


thanks for understanding me. I am very new to ajax so where can i read more about this. Currently I don't understand the rendering of block content or the whole page...

I will also try to google mean while


Look, ajax sends a request and loads response into the page element (div with id='ajax').
Your ajax call looks like this

<a href='javascript:ajaxpage('aboutme.php', 'ajax')'>...</a>

second argument of function call is id of element where need to load response.
Your file 'aboutme.php' contains some html (without 'html', 'head' and 'body' tags).
This is what I call 'content of block'.

Try to copy whole html code from index.php to aboutme.php and make changes in the navigation menu structure.

<a href='aboutme.php'>About Me</a>

And click on it. Your address in the address bar will be changed to http://yogawithgauri.com/aboutme.php


Thanks for explaining me. I had this code before trying to ajax. The problem with this is that the whole page is loaded again. I do not want to load the menu, banner, logo etc to reload with every click, just the content should be reloaded. But then I ended up missing the unique address bar. I need something like below


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.