I’m loading successfully external content to my div with Jquery, the only problem is that I wish to not display: “PastURL+#+NewURL” just the NewURL
For example, right now if I click in some of my links I will have: http://mydomain.com/#http://mydomain.com/loaded-content
What I want to show is just: http://mydomain.com/loaded-content
This is my code:
jQuery(document).ready(function(){
jQuery('.portfolio-item a').live('click', function(e){
e.preventDefault();
var link = jQuery(this).attr('href');
jQuery('#contenthome').fadeOut(500).load(link + ' #content-wrapper', function(){ jQuery('#contenthome').fadeIn(500); });
$('html, body').animate({scrollTop:0}, 'slow');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
});
});
Any ideas?
Thanks in advance!
you can rewrite the url in the address bar using the following script:
Notes:
–