SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7

Thread: JavaScript Menu

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    JavaScript Menu

    I have a JavaScript Menu that I need to select one of the second level items. When originally recorded it recorded this:
    HTMLBrowser("Caption='NCM Web - R&D'").Attach
    HTMLTD("ID='' Index=138").Click 13, 9

    The Click does not work. I changed the code to read:
    HTMLTD ("InnerText='Editorial Content'").MouseMove
    HTMLTD("InnerText='Event'").Click

    This no longer errors in the script but the CLICK never happens.

    I have also tried to Identify the "Event" menu option but the Identify tool does not drill down in the javascript.

    Anyone have any thoughts?

    Thanks
    -Erik

  2. #2
    Member
    Join Date
    Nov 2004
    Location
    NJ, USA
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    The object which contains the actual value to be clicked would be different than HTMLBrowser("Caption='NCM Web - R&D'").
    The object currently attached contains the top-level menu.
    The object that contains the sub-menu items would be different.
    Try recording the script again clicking the actual link and try to find from the recorded script the object of the sub-menu. Then attach that before clicking the sub-menu.

    I think this should solve your problem.
    The Vagabond.
    Thurst yourself into the wheel of madness and action in search of the center. Once you find the center, you cannot be moved.

  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    Well that didn't seem to work unless i am missing something.

    I created an object called NWPmenu for the first level menu list and I attach to that.

    Any other thoughts, thanks for the help
    -Erik


    ' Attach to Caption='NCM Web - R&D'
    Window("NCM Web - R&D - Microsoft Internet Explorer Window").Attach

    ' Attach to Caption='NCM Web - R&D'
    HTMLBrowser("Caption='NCM Web - R&D'").Attach
    HTMLTD("NWPmenu").Attach
    HTMLTD("ID='' Index=138").Click 34, 13

  4. #4
    Member
    Join Date
    Nov 2004
    Location
    NJ, USA
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    Let me know if I understand your problem correctly:
    You have a javascript menu say something like this:
    About Us | Products | Solutions | Contact Us

    When, say, the user moves the mouse/clicks on Products, a list of products "drops-down" from the menu. The user selects a product, say, "Shoes" he/she would be taken to the appropriate page.

    Now you are successfully able to select "Products", but you are facing a problem with selecting "Shoes".
    Do I understand your problem correctly?

    Also try this... I pretty sure that if its a javascript menu, it should be a div tag. Try some view source to figure that out.
    The Vagabond.
    Thurst yourself into the wheel of madness and action in search of the center. Once you find the center, you cannot be moved.

  5. #5
    Junior Member
    Join Date
    May 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    Yes that is the basic concept.

    Here is the code that starts the javascript menu.

    <td><div id='pnwMenu2'></div>
    <script language='JavaScript' type='text/javascript'>
    var pnwMenu2 = [
    blah blah blah

    Thanks again for all the help
    -Erik

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Location
    Bengaluru
    Posts
    494
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    try clicking on first level menu item so that it displays the second level list.

    HTMLTD("NWPmenu").click
    HTMLTD("ID='' Index=138").Click

    or

    HTMLTD("NWPmenu").click
    HTMLTD("InnerText='Event'").Click
    Suraj

  7. #7
    Junior Member
    Join Date
    May 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript Menu

    I finally figured it out, your help did inspire my final code. Here it is for anyone else.

    HTMLBrowser("Caption='*'").Attach
    HTMLSpan("ID='' Index=5").Attach 'top javascript menu
    HTMLSpan("ID='' Index=5").MouseMove
    HTMLTD("ID='' Index=13").Attach 'secondary menu
    HTMLTD("ID='' Index=13").MouseMove
    HTMLTD("ID='' Index=26").Click ' menu item I wanted

    I had to attach each menu and then do a mouse move to over each to get to the menu item i wanted (which is labeled as Index=26). I could then click on that.

    Fun stuff,
    thanks again for all the help.
    -Erik

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:13 AM.

Copyright BetaSoft Inc.