开发者

Changing url using javascript/JQuery

开发者 https://www.devze.com 2023-03-01 06:03 出处:网络
i have a problem with my URL that is i have some thing like this http://somelink.com/mobile/somethinghere

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 开发者_如何学Gosomethinghere in the url will change dynamically i dont need that.

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


Use

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


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'


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消