[TYPO3-core] RFC: Fix use of document.location

Karsten Dambekalns karsten at typo3.org
Wed Jan 11 19:57:42 CET 2006


Hi.

Type: cleanup

Problem:
The BE makes heavy use of JavaScript to change the shown URL. This is in the 
majority of places done by setting a value on document.location. Depending on 
the sources used this is either deprecated, read-only, nonsense or 
non-existing. It works, but has a bitter taste to it.

Solution:
Using window.location.href instead is definitely the better choice. In cases 
where a nother frame is adressed one should use something like 
top.location.href or someframe.location.href.

Additionally window.location.hash should be used when just setting another 
anchor on the same page (one place I found).

The attached (long but simple) patch changes all uses of document.location to 
the new syntax.

Karsten
-- 
Karsten Dambekalns
TYPO3 Association - Active Member
http://association.typo3.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: js-location.patch
Type: text/x-diff
Size: 76338 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060111/42464537/attachment.bin 


More information about the TYPO3-team-core mailing list