Devan
Devan

Reputation: 170

Changing url using javascript/JQuery

i have a problem with my URL that is i have some thing like this

http://somelink.com/mobile/somethinghere

i need it to change it to something like this:

http://somelink.com/mobile/index.html

the somethinghere in the url will change dynamically i dont need that.

So is there any way to avoid that and replace it with the other.

Upvotes: 0

Views: 407

Answers (3)

pramodtech
pramodtech

Reputation: 6270

If Somethingthere is some page on your site, you can write some script on that page which will redirect to Index.html. I think you can use window.onload() to do that.

Upvotes: 0

Max
Max

Reputation: 7119

If you are loading content dynamically and don't want the url to change, use $.load('pageToLoad', function() { }), or modify the location of the window like this: window.location.href='blah'

Upvotes: 0

Ibu
Ibu

Reputation: 43810

Use

location.href = 'http://somelink.com/mobile/index.html'

Upvotes: 1

Related Questions