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

434
Views
Characterizing of an HTML page using a javascript JSON (instead of ajax request)

Here is the context :

I am writing a Python code that converts an HTML page to a PDF file using the instructions in this link. I work now on the POST request that will have as an input an HTML file, and have some parameters precised in the latter link.

The link states that the HTML input file has to be defined by some parameters, grouped in this example:


image

in this example, I don't get what's the meaning of this part : "json": "[\"a\": \"b\"]" ? and how can I adapt it to my case.

So I am struggling with how to precise the parameter highlighted in yellow in the image above.

Here is the question :

The litterature states concerning this field (cpf:inputs > params > cpf:inline > json) states the following:

json(string, optional)

JavaScript variables to be placed in global scope to reference while rendering the HTML.
This mechanism is intended to be used to supply data that might otherwise be retrieved using ajax requests.
The actual mechanics of accessing this content varies depending if rendering from a zip file or from a url.
When rendering from a zip file, the source collateral must include a script element such as:

<script src='./json.js' type='text/javascript'></script>

When rendering from a URL, the content of this json object is injected into the browser VM before the page is rendered.

default: {}

It will help if someone can just read and explain to me the meaning of this quoted text above. thanks!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you don't want to do an Ajax request every time you use your script, you can visit the ajax page, copy the entire content with Ctrl+A, and then paste it into an empty javascript file you can save as module.js for example. When you come to the point where you'd usually do the request, you can replace it by . Good luck!

PS: Your question is very well formulated, I would have upvoted it, but I haven't got enough reputation now...

over 4 years ago · Santiago Trujillo Report
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!