Re: VBS GetElementByClassName custom function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
news:%23vuKffnCIHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
I may be misunderstanding what you want to
do, but if you want all elements of a certain class,
can't you just use Document.All and check the className
attribute of each Item in All?


document.all would be equivalent to doing
document.getElementsByTagName("*")
so the OP is still left with all the original problems with the port.


Yes, but it's easy enough to filter those by tagName
and then className, or vice versa. I'm confused as to why
there would be any reason to even consider bringing XML
or RegExp into it when simple DOM does the job.


The XML came in to it because the OP wants to output a new DOM containing
the selected nodes. Unfortunately it isn't possible to insert nodes from a
HTML document into an XML document.

The RegExp comes into it from the source JScript to determine whether a
specific node has a specific class name in its class attribute. Whether the
node is retrieved by looping 'getElementsByTagName("*")' or by 'all' this
test needs to be done. As I explained in an earlier post the class
attribute may contain multiple class names.

--
Anthony Jones - MVP ASP/ASP.NET


.



Relevant Pages

  • Re: VBS GetElementByClassName custom function
    ... and then className, or vice versa. ... there would be any reason to even consider bringing XML ... or RegExp into it when simple DOM does the job. ...
    (microsoft.public.scripting.vbscript)
  • Re: About a plugin framework!
    ... > XML defining the classname and some extra information and the app will be ... The xml stuff unnecessarily complicates things. ... So the name is not enough - unicode or not. ... > Each module (plugin) can have a different class name defined in the XML ...
    (comp.lang.python)
  • Re: DOM - WebBrowse - Get CLASS of TD (or other) elements?
    ... The TD tag has a className attribute. ... which gives you access to all style sheet properties. ... You really need a local copy of MSDN or a full DOM reference. ...
    (microsoft.public.vb.general.discussion)
  • Re: DOM - WebBrowse - Get CLASS of TD (or other) elements?
    ... The TD tag has a className attribute. ... which gives you access to all style sheet properties. ... You really need a local copy of MSDN or a full DOM reference. ...
    (microsoft.public.vb.controls.internet)
  • Re: Can a Div take a "Float" position?
    ... I meant odd in the sense that many of the IE DOM ... style properties are not the same as straight CSS. ... The same goes for className. ...
    (microsoft.public.scripting.vbscript)