thanks for posting the code. I will try use this in my applet based version to
further allow for such details to be set in the external file.
Jordi - IlMaestro - Ministral wrote:
> Here's some code I used to fix Netscape not applying bgcolor and bgimages of
> external content. The method returns and object with bgColor and bgImage
> properties set to the appropiate values, so you can manually apply them. Notice
> that this won't work for loaded pages, only setHTMLs, because you need the HTML
> string to parse it.
>
> A user pointed me that if the content was complex ( lots of nested tags ) IEs
> performance slowed down up one minute. This can be fixed if you first do a
> string.indexOf(<body'>) and give only a piece of the HTML to the function.
>
> // This is some Regular Expressionism that allows to extract the body bgcolor
> and
> // body bgImage tags of a content string, so after the content has been set the
> layer
> // is given the appropiate bgcolor and bgImage, if any specified.
>
> IbsScrollBgColorTagRegExp =
> /.*<[\s]*body.*[\s]bgcolor[\s]*=[\s]*['|"]?[\s]*(#?\w*)['|"|\s|>].*/i
> IbsScrollBgImageTagRegExp =
> /.*<[\s]*body.*[\s]background[\s]*=[\s]*['|"]?[\s]*([\.\w]*)['|"|\s|>].*/i
>
> function getBgTags(h) {
> var r = new Object()
> m = IbsScrollBgColorTagRegExp.exec(h)
> if(m && m[1]) r.bgColor = m[1]; else r.bgColor = 'white'
> m = IbsScrollBgImageTagRegExp.exec(h)
> if(m && m[1]) r.bgImage = m[1]; else r.bgImage = 'n'
> return r
> }
--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help