Skip to main content

Bug Tracker

Side navigation

#7858 closed bug (invalid)

Opened December 29, 2010 10:43AM UTC

Closed December 29, 2010 02:22PM UTC

Last modified October 08, 2011 10:38PM UTC

Access to attributes of location object

Reported by: daniel.degasperi@r3-gis.com Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

The following code worked with jQuery Versions <= 1.4.2:

$(location).attr('href', 'blank.php');
$(location).attr('href');

With Version 1.4.4 Firebug throws following exception:

a.setAttribute is not a function
http://sandboxes.r3-gis/R3-Trees/sito/web/javascript/jquery/jquery.js
Line 55
Attachments (0)
Change History (5)

Changed December 29, 2010 02:22PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

It may have worked but it was never supported or documented. Simply use document.location.href = "http ..." which is faster, simpler, and easier to understand.

This has come up a couple of times in the past, is this your own code or did you get it from somewhere? Can you provide a link?

Changed December 29, 2010 02:58PM UTC by daniel.degasperi@r3-gis.com comment:2

Thanks for enlightening me.

I've got the code snippet from somewhere in the WEB, but I can't remember the URL. Meanwhile, much time has passed.

Replying to [comment:1 dmethvin]:

It may have worked but it was never supported or documented. Simply use document.location.href = "http ..." which is faster, simpler, and easier to understand. This has come up a couple of times in the past, is this your own code or did you get it from somewhere? Can you provide a link?

Changed August 24, 2011 02:44PM UTC by peter.bremer@gmail.com comment:3

Changed October 08, 2011 09:29PM UTC by anonymous comment:4

Wouldn't a jQuery object like this help to handle browser inconsistencies between document.location.href and window.location.href?

Changed October 08, 2011 10:38PM UTC by timmywil comment:5

There aren't any in browsers we support. They are identical in IE6, FF 3.6, Safari, Chrome, Opera.