Jump to content

Browser address bar not showing full url


Pavlos1316

Recommended Posts

I use this code to open the contents of my Menu Links inside my <div id="main"> so I do not need to reload the whole page each time:
.delegate('a.difflink', 'click', function(){
 $('#content').empty();
 var page = $(this).attr('id');
 $('#content').load("page_scripts/loop_a.php?page="+ page);
Problem created is that by using the above method my browser's address bar always shows www.myXample.com so I cannot create sitemap for SEO.
 
And as I understood (not sure if I am correct) the way I made it work is like there are no new urls to show (since I am just changing div content).
 
QUESTION: Is there a way to make my page work as it should e.g when I press "Downloads" --- address will show: www.myXample.com/downloads and still no need to reload the whole page?
 
A solution would be to use this in my code:
window.history.pushState('','','/downloads');

it changes the url to the desired BUT if I manually enter on my browser www.myXample.com/downloads I get just the contents of the div without any page formatting or menus, which is natural result.

 

So is there a work around to achieve my goal or is it one of two: Reloading the whole page Vs No reloading and no URLs for SEO.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.