• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

125
Vistas
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 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda