kirill578 Posted March 2, 2011 Share Posted March 2, 2011 I have a website in which al the content is displayed in the same page with AJAX. As I know the browser doesn't send any data to the server after the hash symbol ( # ). But the only way to change address bar with no refreshing is location.hash. My question is how can I make the user be able to share the URL that will say ajax what page to load. - I don't want to make text field with the URL - you can look at the website here maadif.co.cc/stuff Quote Link to comment https://forums.phpfreaks.com/topic/229358-address-bar-and-ajax/ Share on other sites More sharing options...
RussellReal Posted March 2, 2011 Share Posted March 2, 2011 onload you should read the hash and handle it the same way you would handle it when sum1 clicks that link document.onload = function() { var option = location.hash.replace('#',''); ajaxObject.loadPage(option); } Quote Link to comment https://forums.phpfreaks.com/topic/229358-address-bar-and-ajax/#findComment-1181954 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.