i have a html template which uses js. I am trying to load an external .html file which contains a table into that html template with js. I am not running this stuff on a webserver.
In the html i have
<div id="table_placeholder">Load table heree</div>
I tried the following in my js:
jQuery(document).ready(function(){
//load the html file
document.getElementById("table_placeholder").innerHTML='<object type="text/html" data="Export.html" ></object>';
//access the loaded table
var title_column_1 = document.getElementById("data").rows[0].cells.item(0).innerHTML;
alert(title_column_1 );
});
The table in the Export.html has the ID "data"
When the able is loaded the html looks like this:
But i am getting: Uncaught TypeError: Cannot read property 'rows' of null
I guess that i cannot access the html table i loaded with .innerHTML within the same js. Is there any way how could i achieve that? Or did i oversee something? Is it a problem with the order of loading all the stuff?