-1

I am using PHP and HTML. I have a link that should be redirected to a page or refresh the page.

I have searched on Google the usage of windows.location.href, but failed.

The redirected html page is shown within the original html page. It seems a common problem but I do not know how to solve. Do you have any ideas on how to solve?

Adam Michalik
  • 9,678
  • 13
  • 71
  • 102

3 Answers3

0
window.location = 'filename.php';

Try this one.

Naveed Ramzan
  • 3,565
  • 3
  • 25
  • 30
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/10948333) – tiny sunlight Jan 19 '16 at 14:45
  • He was using windows.location.href while it should be window.location so that's why I added this one. – Naveed Ramzan Jan 20 '16 at 04:27
0

As seen here, window.location.href is a property that allows you to know the current URL location of the browser. Changing the value of the property will redirect the page.

`window.location.href` = 'http://www.nasa.gov'; //Will take the user to nasa.gov homepage.

Otherwise, as @Atilla Arda Açıkgöz stated in is comment an <a href="#"> will do just fine.

Community
  • 1
  • 1
George Netu
  • 2,758
  • 4
  • 28
  • 49
0

Sorry, I find that there exist xxx.html under the content area. When I remove xxx.html. It is working now.