Odd JS Questions...

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

    Odd JS Questions...

    Ok here goes

    I have an application that (I didnt write and is closed source) that
    outputs HTML and JavaScript, like I said I can do NOTHING on the page
    itself, but would rather have to do it from the page I am calling the
    link from...

    I need to get a value from a var (sorry Im not a JS Guy:)

    <script language="javas cript" type="text/javascript">
    <!--
    function OnLoadScreen()
    {
    var pageHits = null;
    var rep = new Screen(5, 504, pageHits, false, docMapIds);
    if (parent != self) parent.OnLoadSc reen(rep);
    }
    //-->
    </script>

    What I need out of that is the 504 , but I have no way of changing the
    page its on.

    So I am hoping I someone can tell me how I can get the value from
    another page, I can open it however I need to, with a targeted link, or
    whatever.

    I have another hairbrained scheme that would allow me to get the value,
    but It would involve retreviving the page through a .Net app and
    parsing the value out , but this seems like the Looonnngg way aroung
    but not being familiar with JavaScript, I thought I would ask if what I
    want to do is even possible.

    If it is, is there a name for it ? Or some pointers to some resources ?

  • Joakim Braun

    #2
    Re: Odd JS Questions...

    "WertmanThe Mad" <cwertman@webch amps.com> skrev i meddelandet
    news:1103683769 .699855.10710@z 14g2000cwz.goog legroups.com...[color=blue]
    > Ok here goes
    >
    > I have an application that (I didnt write and is closed source) that
    > outputs HTML and JavaScript, like I said I can do NOTHING on the page
    > itself, but would rather have to do it from the page I am calling the
    > link from...
    >
    > I need to get a value from a var (sorry Im not a JS Guy:)
    >
    > <script language="javas cript" type="text/javascript">
    > <!--
    > function OnLoadScreen()
    > {
    > var pageHits = null;
    > var rep = new Screen(5, 504, pageHits, false, docMapIds);
    > if (parent != self) parent.OnLoadSc reen(rep);
    > }
    > //-->
    > </script>
    >
    > What I need out of that is the 504 , but I have no way of changing the
    > page its on.[/color]

    I suppose the 504 can have any value? Provided security allows you to access
    the window, you can get the source code for the function like this:

    var src = theWindowIWantT oAccess.OnLoadS creen.toString( );

    From there on it becomes a parsing job that you can handle. Look up split(),
    which makes arrays from strings based on a delimiter character. You can use
    that to parse out the line with the 504, then split that on ",", and "504"
    will be the second array element.

    Another idea, if you figure out the logic behind the generated values (they
    look like screen-resolution-dependent stuff) perhaps you could figure them
    out for yourself on the fly.

    Joakim Braun


    Comment

    Working...