Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!