Skip Navigation

[Resolved] IE 11 issue with backtick character in injected CSS

This thread is resolved. Here is a description of the problem and solution.

Problem: If I include CSS in a View or Content Template, an error is displayed in the console of IE 11 related to an invalid backtick character in the following code:

wpvViewExtraCss.textContent = `/* ----------------------------------------- */

Solution: This issue will be fixed permanently in a future release of this plugin. Until that time, add the CSS in the Customizer's Additional CSS editor and scope the code using CSS selectors.

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 3 voices.

Last updated by johnD-41 4 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1709101

Pagination is causing a JavaScript error in IE. If I am using AJAX pagination in a View that also includes custom CSS in the Block editor, several JavaScript errors are shown in the browser on IE 11, including "Invalid character" and "Unable to get property 'split' of undefined or null reference".

#1709159

As discussed, I'm escalating this to my 2nd tier support team for some additional investigation. In the meantime, I suggest moving your custom CSS code out of the View and into a separate stylesheet, or into Appearance > Customize > Additional CSS. That will help work around the backtick character issue.

It doesn't seem to have anything to do with pagination, by the way...any View with or without pagination that includes custom CSS will trigger the same issue, due to the method in which custom CSS is injected into the page. I'll follow up when I have some feedback from the 2nd tier team.

#1709667

Hi Team,

Any update on this issue? It is a blocker for us as the layout is broken.

Thank you.

#1709671

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Please see Christian's reply. Until this is fixed, you can move the custom CSS as he describes.

#1709673

Ah yes! Understood - will try to move and check. Thank you.

#1709683

Hello Nigel,

I tried this. Though it works, it has its side effects.

Now I have conflicting styles because everything is being loaded on every page through appearance > customize.

I wanted to keep different views css separated.

So this issue needs to be resolved soon - I can wait temporarily.

Thanks.

#1709695

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, an alternative workaround would be to add a Custom HTML block (outside of the View) and add your CSS style rules there, inside style tags, e.g.

<style type="text/css">
/* your css declarations here */
</style>
#1711755

Another alternative is to scope your CSS using descendent selectors based on the corresponding View ID. For example instead of:

p {
 color:#333;
}

...scope that to only apply to those tags within a specific View:

.js-wpv-layout-view-1234 p {
  color:#333;
}

The issue has been escalated to our developers and and erratum has been posted: https://toolset.com/errata/adding-custom-css-to-templates-and-views-broken-in-ie11/
Feel free to close the forum ticket here and follow the erratum post by clicking "Subscribe to comments" to receive updates as we work to resolve the issue. Thanks again for the report.

#1712367

The workaround has has worked for me temporarily. Looking forward to see the fix in the new build. Thank you!