javascript - How to call table from another HTML page -
i working in zoho. there 2 pages have created namely test
, test2
. need access table
present in test2
page test page
. guess, need call table
name. there mechanism can access test2 table
test
page.
you use localstorage
(http://www.w3schools.com/html/html5_webstorage.asp) in javascript. serialize test2 form's data (e.g. using json), , store localstorage
other window, test, able access.
for example, in test2 have this:
var tablehtml = document.getelementbyid("yourtableid").innerhtml; window.localstorage["sharedtable"] = tablehtml;
and in test
have:
var tablehtml = window.localstorage["sharedtable"]; var table = document.createelement('table'); table.innerhtml = tablehtml; //now table in test2 window if did document.getelementbyid('yourtableid');
here kind of unique situation demo... have 2 jsfiddles represent 2 windows / pages. open first link first because represents test2 must run first in order accessible. open 2nd , see table html other page alerted.
open first (page2): http://jsfiddle.net/mly4tje2/
open second: (page1); http://jsfiddle.net/qx2xodns/
Comments
Post a Comment