Modify ↓
Ticket #7202 (closed bug: fixed)
$(location).attr('href', hrefString) not working in jquery.latest
| Reported by: | stephenrichter@… | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.5 |
| Component: | attributes | Version: | 1.4.3 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
was using jquery-latest.min.ms in my code.
<script type="text/javascript"
src=" http://code.jquery.com/jquery-latest.min.js"></script>
this morning, $(location).attr('href', someHrefString ) was not working for me like it did yesterday. I changed my code to use jquery 1.4.2 from googleapis and the code worked again.
<script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
type="text/javascript"></script>
Change History
comment:1 Changed 3 years ago by john
- Status changed from new to closed
- Resolution set to wontfix
- Component changed from unfiled to attributes
comment:2 Changed 2 years ago by john
- Status changed from closed to reopened
- Resolution wontfix deleted
- Milestone 1.4.4 deleted
comment:3 Changed 2 years ago by john
- Priority changed from undecided to high
- Status changed from reopened to closed
- Resolution set to fixed
- Milestone set to 1.4.5
Welp, we ended up fixing this anyway: https://github.com/jquery/jquery/pull/92
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.

You shouldn't use .attr() on non-DOM elements. You can just do: window.location.href = hrefstring;