Javascript coded table not showing on IE 11

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Post Reply
LANorth
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jul 11, 2019 5:42 pm

Javascript coded table not showing on IE 11

Post by LANorth » Thu Sep 12, 2019 9:57 pm

I have a joomla site that does not have any additional extensions or plugins etc other than those created when joomla was loaded onto my domain. I have used some JavaScript code within an article enclosed in <script>…..</script> tags to create a table and head using the code below and with the default editor set to "None".

My script works perfectly when viewed on Ipad, Android and windows Edge but only shows direct php coded content on windows explorer 11.

I have tried both Beez3 and protostar templates.

I have looked at all the options I can find, including setting my site on IE 11 Compatibility View Settings.

Nothing works.

Please help with some ideas to solve this.

---oOo---

***myInfo is for example only***

let myInfo = [
{ name: "Name 1", height: Height 1, place: "Place 1" },
{ name: "Name 2", height: Height 2, place: "Place 3" },
{ name: "Name 3", height: Height 3, place: "Place 3" },
{ name: "Name 4", height: Height 4, place: "Place 4" }
];


function generateTableHead(table, data) {
let thead = table.createTHead();
let row = thead.insertRow();
for (let key of data) {
let th = document.createElement("th");
let text = document.createTextNode(key);
th.appendChild(text);
row.appendChild(th);
}
}

function generateTable(table, data) {
for (let element of data) {
let row = table.insertRow();
for (key in element) {
let cell = row.insertCell();
let text = document.createTextNode(element[key]);
cell.appendChild(text);
}
}
}
let table = document.querySelector("table");
let data = Object.keys(myInfo[0]);
generateTableHead(table, data);
generateTable(table, myInfo);

waarnemer
Joomla! Hero
Joomla! Hero
Posts: 2261
Joined: Sun May 04, 2008 12:37 pm

Re: Javascript coded table not showing on IE 11

Post by waarnemer » Fri Sep 13, 2019 6:27 am

Hard to tell.. but when in IE11.. hit F12 then choose TAB console and see the error messages for hints...


Post Reply

Return to “General Questions/New to Joomla! 3.x”