Error on pageLoad since fresh install

Permalink 1 user found helpful
I am brand new to Concrete5, and so far I am really pleased with the editing abilities, but I keep getting this same code error which shows up on the actual page during editing and live.

); } } } // called in versions popup ccm_disableLinks = function() { td = document.createElement("DIV"); td.style.position = "absolute"; td.style.top = "0px"; td.style.left = "0px"; td.style.width = "100%"; td.style.height = "100%"; td.style.zIndex = "1000"; document.body.appendChild(td); }

It has been appearing inconsistently since I installed (fresh) C5 on my server, even before I added any add-ons or themes. It also happens regardless of particular theme. When the error occurs the CSS link for the block edit forms is lost and they lose function. They also open full-page and not as a pop-up. The CS5 menu also freezes.

Sometimes, if I keep reloading the page it go away and everything will function and look normal again. As soon as I update a block and save it it comes back.

Any help would be appreciated.

piceloni
 
Shotster replied on at Permalink Reply
Shotster
That seems to indicate some client-side JavaScript issues. Is the site publicly accessible? If you can point us to it, we might be able to help further.

-Steve
Mnkras replied on at Permalink Reply
Mnkras
im pretty sure all files wern't uploaded
piceloni replied on at Permalink Reply
piceloni
I made the site accessible, so you can take a look. It's only the one page for now, since I'm working on converting a theme from another format to C5.

http://testconcrete.joydilworth.com/...

I uploaded all files from the installation .ZIP onto my server, so the only way something would be missing is if something wasn't included in the install package to begin with. Which I guess could be possible.
whitecliffs replied on at Permalink Reply
Hi folks,

This is my first post and I seem to be experiencing the same issue as above upon uploading a fresh install of 5.4.1.1.

The problem appears to me to relate to browser parsing, whereby the browser gets confused while parsing the source HTML. The browser parser encounters the </script> tag immediately before the code that you are seeing and assumes that it indicates the end of the current script it is parsing. Oops, it is not, that </script> is actually part of another js function that is wrapped up inside the current script that is being parsed.

Did the parser not see the 2nd start <script> tag? Are nested js scripts even valid under the validator.w3.org XHTML spec? Anyone? Kinda interesting if anyone knows more please enlighten.

Anyway, I am seeing the parser stopping the current script early and then rendered out the remaining js (assuming it is content) until it trips over the next valid piece of HTML that it finds and starts processing correctly again.

The javascript file that is injected between <script> tags and effectively results in an early end to client side parsing comes from /concrete/js/ccm.base.js and this .js file is called by /concrete/elements/header_required.php

You can try to break the false script tags for the client parser with something like:

$('head').append('<scr' + 'ipt type="text/javascript" src="' + item + '?ts=' + new Date().getTime() + '"></sc' + 'ript>');

If someone on the forums can explain better then please feel free to set me straight.

Thanks,
whitecliffs
whitecliffs replied on at Permalink Reply
Hi again,

If anyone out there has the same problem it does appear (at least at this point) that the issue does relate to browser parsing and a change to how javascript is added to the head of concrete5 documents when moving from 5.4.1 to 5.4.1.1. If you have both installs check the source to compare.

Break the script tag as described above and you should be fine. At least this fixed the issue for me.

If someone else out there would like to suggest something more robust or a better explanation then by all means jump in, i'm listening.

I can't see how this issue is not happening to everyone who is running 5.4.1.1? Admittedly, on a few occasions the first page load may be correctly parsed, but, hit refresh and hello javascript :)

If anyone is wondering, I'm seeing this issue on OS X 10.5.8 and this issue occurs in Safari 5.0.1 (5533.17.8) and Firefox 3.5.16 and I looked no further.

Thanks again,
whitecliffs