www.webdeveloper.com
Results 1 to 2 of 2

Thread: EVAL in Imacros for Firefox

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Posts
    18

    Question EVAL in Imacros for Firefox

    Dear all,
    I'm new with JavaScript, so can please help me with this macro?
    I need to reload URL (in this case refresh same page) until I don't have word beginning with capitalized A, B or C.
    I can't find the way to create loop inside EVAL.
    Can somebody help me please?
    Thank you!

    Code:
    VERSION BUILD=7401110 RECORDER=FX
    TAB T=1
    URL GOTO=http://watchout4snakes.com/CreativityTools/RandomWord/RandomWord.aspx
    SET !EXTRACT_TEST_POPUP NO
    TAG POS=1 TYPE=SPAN ATTR=ID:tmpl_main_lblWord EXTRACT=TXT
    SET !VAR1 EVAL("var re = /^[A || B || C]/gi; var str = \"{{!EXTRACT}}\"; while(str.search(re) == -1) {URL GOTO=http://watchout4snakes.com/CreativityTools/RandomWord/RandomWord.aspx}")
    PROMPT {{!EXTRACT}}

  2. #2
    Join Date
    Nov 2010
    Posts
    18
    I already asked on iMacros forum, but I don't have answer until now.
    With this part of code I need help, where {{!EXTRACT}} is extracted word (variable) from page. So, while {{!EXTRACT}} is not word that starts with uppercase letter A, B or C, I need to go again and again on the same URL (in this case to refresh same page):

    Code:
    var re = /^[A || B || C]/gi; 
    var str = \"{{!EXTRACT}}\"; 
    while(str.search(re) == -1) 
    {
    go to this URL
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles