I rebuild the site (site before). I have on the site two or more Webparts. These CEWP are including the same JavaScript and this the JavaScript is displaying a table via:
document.getElementByID(divID).innerHTML=tableHtml;
This code is in the CEWP (The divID and the typeNumber are different for each webpart the rest is the same):
<script src="https://www.intranet.i/.../status.js" type="text/javascript"></script>
<script type="text/javascript">
var statusObj = new Status(typeNumber, "divID");
var tableOutput = statusObj.startOutput();
</script>
<div id="divID" />
The problem is: When I reload the page sometimes it works and all tables are displayed correctly and sometimes only one table is displayed. I wasn't able to find any regularity.
Edit:
When i run the Debugger i got this Error:
throw Error.create(SP.Res.collectionHasNotBeenInitialized)
SCRIPT5022: Die Sammlung wurde nicht initialisiert. Sie wurde nicht angefordert, oder die Anforderung wurde nicht ausgeführt. Ggf. muss die Anforderung explizit erfolgen. sp.runtime.js?rev=9sKdsC9N6p2BiRk3313M7Q%3D%3D, Line 2 Character 23256