Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
The <cdnjs> (Chart Js) library only renders a chart in a Post when the user is logged into WordPress

First of all I am a beginner user in wordpress; The last few weeks I have tried to build a "graph" that will be shown to the user in a Post at the end of a survey. I carried out the survey using the GravityForms plugin, the "Post" where the result of the survey will be displayed next to the graph is automatically created by a GravityForms Add-On after the user presses the "Submit" button. I was able to make the chart using ChartJs after inserting a reference to a CDN in the topic header as follows:

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js" integrity="sha512-vBmx0N/uQOXznm/Nbkp7h0P1RfLSj0HQrFSzV8m7rOGyj30fYAOKHYvCNez+yM8IrfnW0TCodDEjRqf6fodf/Q==" crossorigin="anonymous" referrerpolicy="no-referrer" type="application/javascript"></script>

I made the chart using hooks from functions.php to be able to handle the data that the user inserts in the form and thus insert in the content of the Post an element of type where the chart with the results of the survey will be:

Chart maded with ChartJs

The problem is that this only works when I am logged into Wordpress, when I share the link so that someone else can fill out the survey or when I do it from incognito mode instead of showing me the chart, the Post shows me raw text:

Raw text

Why is it that I can only see the chart when I am logged into Wordpress?

about 4 years ago · Juan Pablo Isaza
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda