Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
s.substr is not a function

I am using canvg, but when I run this:

jQuery("#print").on("click", function() {
    mySvg();
});

function mySvg() {
    var svg = jQuery("#map svg");
  canvg(document.getElementById('canvas'), svg);
}

I get this in console

canvg.js:58 Uncaught TypeError: s.substr is not a function

Here it is a jsFiddle

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Siguza is correct, you want to get the inner HTML of your SVG so (assuming #map is the direct parent of your target svg):

var svg = jQuery('#map');
var txt = svg.innerHTML;

Then you want to pass the txt variable as your second canvg() argument.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda