6

how do i use jquery [javascript] to goto another page?

or change the url in the browser urlfield and hit enter?

gahooa
  • 131,293
  • 12
  • 98
  • 101
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383

2 Answers2

13

nothing to do with jQuery, just this:

window.location.href = 'whatever.html';
nickf
  • 537,072
  • 198
  • 649
  • 721
4

(Plain old javascript)

window.location = 'http://another-place.com';
gahooa
  • 131,293
  • 12
  • 98
  • 101
  • 1
    @BipedalShark LOL. True but since jQuery has no method for doing this I think they're just going to have to step out of jQuery-world (as painful as that is I admit) sometimes. :) – Darrell Brogdon Dec 06 '09 at 04:17
  • @Darrell, I guess `$(window).attr("location", "http://another.com")` might work.. but what a waste of function calls... haha! – Doug Neiner Dec 06 '09 at 04:23