Odd JS Questions...

W

WertmanTheMad

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="javascript" type="text/javascript">
<!--
function OnLoadScreen()
{
var pageHits = null;
var rep = new Screen(5, 504, pageHits, false, docMapIds);
if (parent != self) parent.OnLoadScreen(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 ?
 
J

Joakim Braun

WertmanTheMad said:
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="javascript" type="text/javascript">
<!--
function OnLoadScreen()
{
var pageHits = null;
var rep = new Screen(5, 504, pageHits, false, docMapIds);
if (parent != self) parent.OnLoadScreen(rep);
}
//-->
</script>

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

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 = theWindowIWantToAccess.OnLoadScreen.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top