i played around with the code you submitted, it had problems with working out where
the values ended.

I changed the RegExps to the following and had better luck.  any anyone find
problems, please yell at me and tell me to get back into my hole.

IbsScrollBgColorTagRegExp=/.*<[\s]*body.*[\s]bgcolor=['|"](#?\S*)['|"].*/i;
IbsScrollBgImageTagRegExp=/.*<[\s]*body.*[\s]background=['|"](\S*)['|"].*/i;

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
> }
>
> Richard Bennett wrote:
>
> > That's better. thanks.
> > I put the example up here:
> > http://www.richardinfo.f2s.com/dynapi/php/examples.html
> > (scroll to bottom)
> >
> > A few things I noticed:
> > * NS 4 looses the background color of the DynLayer after loading (not so
> > important for me)
> > * NS 4 looses onmousedown (& click-up etc) listeners for all links on the
> > main page.
> > * If you use panel1.getHTML(), it returns the actual load element, like the
> > <div> or <iframe>, do you think it's possible to update the variable
> > this.html with the actual content? - probably difficult in NS4 again, but
> > IE/dom would be a start.
> >
> > Cheers,
> > Richard Bennett
> >
> > [EMAIL PROTECTED]
> > www.richardinfo.com
> > (Everything running on, and ported to DynAPI2.51)
> > visit the DynAPI homepage (and FAQ) ::
> > http://dynapi.sourceforge.net/dynapi/index.php?menu=1
> > Browse (and search) the mailinglist here:
> > http://www.mail-archive.com/index.php3?hunt=dynapi
> >
> > ----- Original Message -----
> > From: "Gabriel Suchowolski" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, May 06, 2001 9:49 PM
> > Subject: [Dynapi-Help] problem with toloadlayer fixed
> >
> > > Here is the new version 22b of toloadlayer attached to this email
> > >
> > > - bug fixed for files with no links
> > >
> > > Gabriel Suchowolski
> > > www.microbians.com - [EMAIL PROTECTED]
> > >
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help

--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010




_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to