I am developing reusable code for Web Pages, creating fixed portions of the page as objects ('scriptlets') contained in an external .js file. Each object is assigned a VARIABLE name. (Eg: VARIABLE="...A bunch of text that appears on every page blah blah blah etc...')
The page is constructed with a series of 'document.write(VARIABLE)' instructions embedded in the page in <script> tags, and positioned with tables and/or CSS.
These work fine on my local client machine, but when uploaded to the web, I notice that until the page has been refreshed and cached in the browser, they do not always 'fire' reliably, leaving occasional unpredictable 'bald' patches in the resulting pages. (And yes, the external .js script is loaded in the <HEAD> tags.)
I'm experimenting with 'onload' function, but anyone had experience of this problem and evolved a fireproof solution?
Ta,
'Luvbytes'
The page is constructed with a series of 'document.write(VARIABLE)' instructions embedded in the page in <script> tags, and positioned with tables and/or CSS.
These work fine on my local client machine, but when uploaded to the web, I notice that until the page has been refreshed and cached in the browser, they do not always 'fire' reliably, leaving occasional unpredictable 'bald' patches in the resulting pages. (And yes, the external .js script is loaded in the <HEAD> tags.)
I'm experimenting with 'onload' function, but anyone had experience of this problem and evolved a fireproof solution?
Ta,
'Luvbytes'