0

What's the difference between this word and action?

<script>
window.location.href = 'index.php';
window.location = 'index.php';
</script>

because some instances that after clicking the button there is a milisecs thats see the way of changing the page..what is that?

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
  • 2
    In case of assignment, there is no difference. – John Dvorak Feb 14 '13 at 07:28
  • 1
    possible duplicate of [Differenece between window.location and location.href](http://stackoverflow.com/questions/9903659/differenece-between-window-location-and-location-href) – Samuel Liew Feb 14 '13 at 07:36

1 Answers1

1

window.location.href returns the location of the current page while window.location returns a Location object, which contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL.

Check here

Savas Vedova
  • 5,622
  • 2
  • 28
  • 44
  • thanks bro this will help thank you so much i just want to clarify my self :) –  Feb 18 '13 at 07:28