By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

Remote Table connectivity Using Javascript

P: 4
I Have a File a.html
file Content
[HTML]<html>
<body>
<table>
<tr><td id="table1">this content from b.html</td></tr>
</table>
</body>
<html>
[/HTML]
b.html
file content
[HTML]<html>
<body>
<table>
<tr>
<td id="table2">this content should go to a.html table cell</td>
</tr>
</table>
</body>
</html>
[/HTML]
In this case how i shold transfer the data from table id ="table2" from a.html to table id="table1" which is in b.html using javascript code..

How can i made remote table connectivity??????

Is there is any possible?????
pls rectify my doubts if there is any javascript experts?????
Sep 25 '08 #1
Share this Question
Share on Google+
7 Replies


Expert 100+
P: 392
If the two different files are loaded in frames in the browser at the same time you can use JavaScript to pass data from one to the other. If on the other hand you are wanting to pass data to a page that is not loaded in the browser JavaScript can not do that.

Passing data from one page to another would require a server side language like Java, PHP, ASP, etc.
Sep 25 '08 #2

P: 93
If anyone wants to pass contents of one to another then for example these are the possible cases:

Case1:If a.html has opened b.html then the data of b.html can be passed to a.html.

Case2:If a.html and b.html are in the two of the different frames of the same window.


Then you can pass the thing in chain like using the object top.opener.document and top.frame['name of the frame']


other Java can help you in other case.
Sep 26 '08 #3

acoder
Expert Mod 15k+
P: 16,027
There's two other possibilities which are limited, but possible with a small amount of data. One is cookies and the other is passing through the URL when opening the other page which can then be parsed using the String methods on location.search.
Sep 26 '08 #4

P: 93
Yes acoder that is the thing as he had told he want to parse the table so this can be achieved through the two possible case which I had posted in the previous post.location.search and cookies can't handle a table having 5 or 6 rows and more than 3 columns.
Sep 26 '08 #5

rnd me
Expert 100+
P: 427
Yes acoder that is the thing as he had told he want to parse the table so this can be achieved through the two possible case which I had posted in the previous post.location.search and cookies can't handle a table having 5 or 6 rows and more than 3 columns.

you don't need frames or loaded pages at all.

simply ajax in "b.htm", set a new tag's .innerHTML to the responseText, find the table in the new tag using getElementsByTagName, clone the nodes, and append them into the mater table.
Sep 26 '08 #6

acoder
Expert Mod 15k+
P: 16,027
Heh, how could I forget that? ;)

The fifth possibility probably being the "best".
Sep 26 '08 #7

P: 93
Yes of course rnd that is fine .I was trying to do only it with javascript.As also I dont know much about the ajax utilities.
Sep 29 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.