Home > AJAX > Change URL by AJAX

Change URL by AJAX

We can change the Content of current page to another page using AJAX.

JavaScript Code:

function ChangeURL()


/*change the content of div “contentForm2″ to content of page  ‘Scan.aspx’*/

$.ajax({url:’Scan.aspx’+’?rel=tab’,success: function(data){$(‘#contentForm2′).html(data);}});

//Change the URL to Scan.aspx

window.history.pushState({path:’Scan.aspx’},”,’Scan.aspx’);return false;


Unfortunately the scripts inside Scan.aspx are not running when it loaded in to the page.(I can’t see).

Categories: AJAX Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: