Click to See Complete Forum and Search --> : Run Script on anther page and return results ?


Taffy
February 7th, 2006, 03:39 PM
Hi,

I'm trying to run a script thats sitting on another page , say http://xxxx.com/js/TestScript.js.

I'm have this bit of HTML / JS code to run it,

</SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="http://xxxx.com/js/TestScript.js?version=10"></SCRIPT>
<SCRIPT TYPE="text/javascript" DEFER="DEFER">
window.setTimeout("TestScript=new TestScript(\"strTestScriptBuffer\");TestScript.run();", 100);
</SCRIPT>


which works fine , but can i use say a webbrowser control from a VB app and i get a return TestScript results and store into a variable ?

So i navigate to this page with the initial script, that script fire the script on the other page and returns the values itto a string Var ?

thanks !

PeejAvery
February 8th, 2006, 01:43 PM
Create a hidden input on the page that should receive the return. Now when the script runs, set the hidden input on the other page to that value.

Taffy
February 8th, 2006, 08:08 PM
Ok well its not quite as strightforward as that as the page ins't actually mine nor is the script. I meant before that i can run the script from a VB app ok by using the script control and the webbrowser control, but i cant get a return of the data.

The script updates users that are online, so hence when the page load a script in an iframe is fired at the end of the loading, this fires the remote script, the remote script parses out the user ID's from the webpage, queiries the server as to who is or isn't online and returns this to the page and chages the online gif's as needed, but i wanted to tap into this script so that i can produce a list of online users from a VB app, what i need to know is, is this actually possible, i don't think it is..?

PeejAvery
February 8th, 2006, 11:32 PM
Since this is actually a VB question, private message Dr. Script or a Super-Moderator and ask them to move this post to that forum.

Unless that script actually posts the data to some input device or DIV, you can't. Depending on how the names are coded you might be able to parse the webpage.

Taffy
February 9th, 2006, 12:09 AM
i worked it out.

PeejAvery
February 9th, 2006, 12:56 AM
Then please do two things...
1. Post how you solved your problem for others who might benefit in the future.
2. Ask a moderator to move this so that it will be in the correct forums for those to whom it applies more readily.

Dr. Script
February 9th, 2006, 05:04 PM
1. Agree
2. It depends. If this is VBScript, then it belongs here. If it is VB, it either belongs in the Visual Basic 6.0 or VB .NET forum. If you think it's be preferred there, I'll move it. But if this is VBScript, I'm thinking that this forum is the correct one.

PeejAvery
February 9th, 2006, 05:06 PM
...I meant before that i can run the script from a VB app ok by using the script control and the webbrowser control, but i cant get a return of the data.
This is why I think it is VB and not VBScript.

Taffy
February 9th, 2006, 08:10 PM
This is why I think it is VB and not VBScript.

It's Client and Server side JavaScript, but veered off into VB a bit. Doesn't matter i have it sorted anyway.

thanks!

Dr. Script
February 9th, 2006, 08:12 PM
Please provide your solution for future references!
Thanks!

Seems fine Paul ... I don't think we need to move this, but keep up the good work!