how to trigger a .js from script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • livin

    how to trigger a .js from script?

    I use a web page that brings up a table with a series of links that look
    like this...

    <a href="javascrip t:GetAgent('MA1 42')">

    these links open pages that look like this...


    I'd like to use a script to sequentially trigger each link to open the pages
    one at a time so I can get the info from the pages that open with the links.

    Can someone help by showing some example code as to how to either trigger
    the GetAgent script or to send the full URL... I'm a pretty lousy scripter.

    I appreciate the help!


  • Dr Clue

    #2
    Re: how to trigger a .js from script?

    livin wrote:[color=blue]
    > I use a web page that brings up a table with a series of links that look
    > like this...
    >
    > <a href="javascrip t:GetAgent('MA1 42')">
    >
    > these links open pages that look like this...
    > http://info.webpage.com/Roster/Scrip...sp?PubID=MA142
    >
    > I'd like to use a script to sequentially trigger each link to open the pages
    > one at a time so I can get the info from the pages that open with the links.
    >
    > Can someone help by showing some example code as to how to either trigger
    > the GetAgent script or to send the full URL... I'm a pretty lousy scripter.
    >
    > I appreciate the help![/color]

    If the pages you are manipulating are *not* on your own site, then
    you will need to do some extra work to bypass the cross-domian
    security features, but none the less , the notes below might help

    Use an <iframe name="IFviewpag es" onload="doSomet hing()"
    src="blank.html "></iframe>

    Each time a page loads in the iframe, your function would get called.

    in that function you can obtain the links
    self.oIFviewpag es=self.documen t.getElementByI d("IFviewpages" )
    self.aLinks=sel f.oIFviewpages. contentWindow.d ocument.getElem entsByTagName(" A")

    you can iterate through these and run them into a second iframe
    setup like the first with it's own onload funtion to parse the page ,
    then trigger the next link in the array

    There is also XMLHTTP , which could be more usefull in retrieveing
    the page contents.




    --
    --.
    --=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
    --=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
    --=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
    --.

    Comment

    Working...