Modify ↓
Ticket #7607 (closed bug: duplicate)
$(window.location).attr('href', 'foo');
| Reported by: | sasfater@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.5 |
| Component: | attributes | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I use this with jquery 1.4.2. and it was ok.
After upgrading 1.4.4 it says: a.setAttribute is not a function
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks for taking the time to contribute to the jQuery project by writing a bug report! But why do you even use .attr() on a non DOM element? It's easier and faster to do window.location.href = foo.
The next time please also submit a reduced test case along, which reproduces the issue you are experiencing (on http://jsfiddle.net). So that we can more easily investigate your issue further.
Btw. did you try searching the bug tracker for similar tickets, because you should have found #7500 and #7605 or one of the other many duplicates of #7500.
If/When that bugs gets fixed this should all be happily working again. In the mean time just use window.location.href = foo