title | page_title | description | slug | previous_url | tags | published | type | category | res_type |
---|---|---|---|---|---|---|---|---|---|
SyntaxError Occurs in the Browser |
SyntaxError Occurs in the Browser |
Learn what to do when syntax errors occur in the Internet Explorer, Chrome, or FireFox browsers when working with Telerik UI for ASP.NET AJAX. |
syntax-browser-errors-occur |
ajax/troubleshooting/known-reasons-for-error-messages, controls/ajaxmanager/troubleshooting/known-reasons-for-error-messages |
telerik, asp, net, ajax, manager, panel, syntax, error, occurs, in, different, browsers |
true |
troubleshooting |
knowledge-base |
kb |
Product | Progress® Telerik® UI for ASP.NET AJAX AjaxManager | Progress® Telerik® UI for ASP.NET AJAX AjaxPanel |
Depending on the browser, the following errors occur:
-
SyntaxError
in Internet Explorer -
Uncaught SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule'
in Chrome -
SyntaxError: An invalid or illegal string was specified
in FireFox
The cause for these errors are the commented CSS rules in the <head>
of your page, for example, /* .someClass { display: none; } */
. The AjaxManager and Ajaxpanel update the <head>
of the page to enable controls to register stylesheets and scripts during an AJAX request. Such commented rules cannot be parsed by the engine.
To solve this issue, use any of the following approaches:
-
Set the
EnablePageHeadUpdate
property of the Ajax control tofalse
. -
Remove the commented CSS rule or move it to a separate stylesheet file.
-
Place the styles settings in external CSS files.