News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Javascript

Started by blsilks, December 28, 2004, 08:56:06 AM

Previous topic - Next topic

blsilks

Does anybody know of any javascript that allows you to pull variables from a form on some other webpage and display them in a table on your web page?  I have a webpage that shows certain statistics and I have made a link that when you click on it, it opens the page in a new window, fills in all of the data fields and then submits while everything is hidden and then displays the statistics that I am interested in.

<td border="0" bordercolor="#6B8EAE"><a href="javascript:document.statsform.submit()"><font size="3"><b><u>Whatever Stats</u></b></font></a></td>
<form name="agentform" ACTION="http://www.whateveer.com/stats" METHOD="POST" target="Whatever_Stats">
<input type="hidden" NAME="ap_num" value="245,251,256,257,258,259">
<input type="hidden" NAME="node" value="4"></form>


What I need is a way to pull the data from the other page that has just populated and then display it on my page that way I dont have to click submit or anything like that.  I just want to display the data in a table.

deathshadow

Javascript cannot read data from another file - doesn't work. You MIGHT be able to pull it off though by loading the other web page into an iframe transparantly, then using the document.window.contents object, although I don't think that will work in anything other than IE. (even then, while I know you can write to the contents, I'm not sure about reading from it)

Realistically you should probably be writing out your tabulated data to either a .txt file or a SQL database, then generating your various pages to display it in Perl or PHP.

Oh, btw, shouldn't this be in the Scripting forum?
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
http://www.cutcodedown.com

[Unknown]

Actually, you could use XmlHttpRequest, but... browser support is a little shifty.

--> Scripting Help.

-[Unknown]

Advertisement: