Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ajax - Manipulating the # value AFTER a http request

Featured Replies

Ok, i've got this (see below :)) so far, and it works great, however because i'm using a base url, i'm getting urls like

 

mydomain.com/services/#services/my-service.php

 

Which obviously doesn't look too great,

 

This is what i have

 

		 $(document).ready(function() {   
		function showNewContent() {
			$("#dynamic").fadeIn();
			$("#load").fadeOut();   
		}   
		function pageload(hash) {
			if(hash) {
				$("#dynamic").load(hash + " #dynamic " ,function(){
					if($("img:last",this).get(0)) {
						$("img:last",this).load(function(){
							showNewContent();
						});
					} else {
						showNewContent();
					}
				});
			} else {
				$("#dynamic").load("services/index.php #dynamic");
			}
		}
		$.historyInit(pageload);	
		$("ul.service-nav li a").click(function(){
			var hash = $(this).attr("href").substr(0,$(this).attr("href").length,0);
			$("#dynamic").fadeOut(300,function(){
				$.historyLoad(hash);
			});
			if(!$("#load").get(0)) {
				$("#dynamic").append(\'<img src="images/icons/loading.gif" class="loading-center" />\');
			}
			$("#load").fadeIn("normal");
			return false;
		});

	});

 

Now if i change this

 

var hash = $(this).attr("href").substr(0,$(this).attr("href").length,0);

 

to something like this

 

 var hash = $(this).attr("href").substr(0,$(this).attr("href").length-4);

 

I get the desired url, however it effects the request so it can't find the page, my question is how would i go about sending the request and then manipulate the #

 

Anyone know? Or point me in the right direction?

  • 3 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.