I was wrong. The removal works. But it seems, that clicking on a link which removes the DOM link tag doesn't affect the browser rendering. So the DOM link tag is removed, but i still get a unaltered pageview.

This regards to Safari Mac and also IE 7 Win.

On FF 2/3 (Mac, Win) all is fine: Clicking on a link to reset the pageview, the appropriate link tag is removed from the DOM AND the styles of the former appended stylesheet doesn't affect the pageview no longer.

Thanks for your help.

bye
Olaf


Am 13.02.2009 um 13:05 schrieb Karl Rudd:


If the removal really doesn't work you could try disabling the link.
$(linkHere).attr('disable',true).

Karl Rudd

On Fri, Feb 13, 2009 at 7:22 PM, Olaf Gleba <l...@creatics.de> wrote:

Hi.

On a click event i DOM insert (append) a LINK tag into the head.

var s = document.createElement('link');
s.href='/gtpls/'+target+'.css';
s.rel = 'stylesheet';
s.type = 'text/css';
s.media = 'screen';
$('head').append(s);

There is a link to the former created DOM Element to set all to standard,
e.g. restores the standard view.

$('a[rel=default]').click(function() {
  $('HEAD').find('link[href=<path-to-css>]').remove();
 ...
});

Everythings fine except Safari 3.2.1. It seems to find the target link tag
(gives me 1 when i check length), but doesn't remove it on the fly.

Is that a known issue on safari? Any hints to achive the desired behaviour?

greets
Olaf

--
Olaf Gleba : creatics media.systems
Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225
o...@creatics.de : http://www.creatics.de
PGP-Key http://www.creatics.de/keys/

Welcompose CMS - Einfach und Effizient
http://www.welcompose.de








gruss
Olaf

--
Olaf Gleba : creatics media.systems
Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225
o...@creatics.de : http://www.creatics.de
PGP-Key http://www.creatics.de/keys/

Welcompose CMS - Einfach und Effizient
http://www.welcompose.de



Reply via email to