Issue #768💬 AnsweredOpened January 16, 2018by frank-tenzing0 reactions

IE browser issue

快速解答by artf

@frank-tenzing not sure if it's IE's only error, are you facing this issue with some kind of template (which probably contains some SVG element)?

Read full answer below ↓

Question

代码片段TEXT
Hi @artf ,

Created this issue due to https://github.com/artf/grapesjs/issues/214 has been closed ...

I cloned the latest repo and run it on IE 11, an error: 
`SCRIPT438: Object doesn't support property or method 'replace' - grapes.min.js (15612,7)` 
demonstrates on the console, when I clicked it, it jumped to the line in 'removeClass' function:
`  function removeClass(v, c) {
    if (v.classList) {
      v.classList.remove(c);
    } else {
      v.className = v.className.replace(c, "");
    }
  }`
The 'v.className' was '**SVGAnimatedString**' type when I debug it, but there is no `replace` function for that type. What is supposed to do here and When will this function be called ? Thank you very much!

Answers (3)

artfJanuary 17, 2018

@frank-tenzing not sure if it's IE's only error, are you facing this issue with some kind of template (which probably contains some SVG element)?

frank-tenzingJanuary 17, 2018

Hi @artf , what I have done after cloned the latest repo are

代码片段TEXT
1). Replaced the start script with `"start": "webpack-dev-server --open --progress --colors & npm run build:css -- -w",;` 
2). Commented the 
**editor.BlockManager.add('testBlock', {
        label: 'Block',
        attributes: { class:'gjs-fonts gjs-f-b1' },
        content: `<div style="padding-top:50px; padding-bottom:50px; text-align:center">Test block</div>`
      })**
in **index.html**; 

Then when I run it on IE 11, `SCRIPT438: Object doesn't support property or method 'replace'`, `grapes.min.js (15612,7)` is showing on the console. 
`  function removeClass(v, c) {
    if (v.classList) {
      v.classList.remove(c);
    } else {
      v.className = v.className.replace(c, "");
    }
  }`

And when I debugged it, `v.className` parsed as **SVGAnimatedString**.
artfJanuary 18, 2018

@frank-tenzing thanks, but what about other browsers?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.