SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    May 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery Xpath Selectors

    Hello. I deal with a web page that contains subframes i.e. frameset doctyped document. When I use below code
    Code JavaScript:
    $('/html/frameset')
    it works accurately but for the topmost window. Now I need to work in subframe scope and use xpath selectors. I tried
    Code JavaScript:
    $(window.parent.frames[1].document)
    to reach subframe document but dont know how to use xpath selectors with jquery for that frame document.
    Code JavaScript:
    $(window.parent.frames[1].document).find('/html/body/p')
    Abıve code didnt work , by the way. How can I solve this problem?

    Thanks in advance.

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $ is not a native method of ecmascript, try looking at a reference for the framework you're using.

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you're not including jquery in the frame document, so it doesn't know what "document.find" is?

  4. #4
    SitePoint Addict
    Join Date
    May 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello. Sorry for late reply. I have found that xpath expressions can be only used as selector with basic xpath plugin installed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •