admin管理员组

文章数量:1305366

I want to make the URL from a next page non-editable when I open a link like this:

<a href="javascript:window.location=''">Enter Lobby</a>

Is it possible to make the window.location parameter non-editable through Javascript or PHP?

I want to make the URL from a next page non-editable when I open a link like this:

<a href="javascript:window.location='http://google.co.in?test=raj'">Enter Lobby</a>

Is it possible to make the window.location parameter non-editable through Javascript or PHP?

Share Improve this question edited Jan 28, 2014 at 10:59 Patrick Hofman 157k23 gold badges267 silver badges339 bronze badges asked Jan 28, 2014 at 10:02 RajanRajan 751 gold badge1 silver badge13 bronze badges 1
  • 1 Do you mean: prevent the user to edit the URL in the browser? – Patrick Hofman Commented Jan 28, 2014 at 10:04
Add a ment  | 

1 Answer 1

Reset to default 7

See this w3schools article on window.open:

window.open("http://yoururl/", "title", "location=no");

The third argument are the specs. Pass location=no there.

If you want to disable URL change on the current page, sorry, that is not possible.

本文标签: javascriptPrevent user changing URL in browserStack Overflow