I need some XPath / RegExp help, particularly in relation to IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StuartD
    Sofa King Band
    • Jul 2002
    • 29903

    #1

    I need some XPath / RegExp help, particularly in relation to IE

    Here's the basics... I have a word, say the word is "test".

    What I want to be able to do is use javascript to navigate the DOM of the html document and find every instance of the word "test" but NOT if it's with in an img tag, or link or used anywhere that's not just standard text.

    So for example:
    <p>This is just a test</p> - find
    <a href='#'>click test</a> - don't find
    <img src="images/test.jpg"> - don't find

    I am currently using XPath which is able to differentiate a "textNode" from everything else, and thus, give me the results I want.
    But IE's piece of crap browser will not use XPath on anything but XML. And I need for this to work in HTML.

    I figure my only alternative is to use RegExp but something of this magnitude is simply over my head.

    Any help would be greatly appreciated.... either in this thread, or even by icq (563-6347)
    This is me on facebook
    This is me on twitter
  • StuartD
    Sofa King Band
    • Jul 2002
    • 29903

    #2
    Thank you mrkris, you rock!
    Your help is much appreciated, it now works like a charm
    This is me on facebook
    This is me on twitter

    Comment

    • mrkris
      Confirmed User
      • May 2005
      • 2737

      #3
      Originally posted by StuartD
      Thank you mrkris, you rock!
      Your help is much appreciated, it now works like a charm
      anytime!

      PHP-MySQL-Rails | ICQ: 342500546

      Comment

      Working...