[JSON Pretty Format Reactive] ReferenceError: $ is not defined
Forge component by Pedro Domingues
Application Type
Reactive

I have tried to implement this webblock but I keep getting this error when I ran an action to pass the JSON to the webblock. The error is: "ReferenceError: $ is not defined"
Nothing is displayed/visible on the screen not even a visible input text box that I see on the screenshots/demo.

Is it possible to also add a demo to download if possible?


ps. I have added the OSUI JQuery script as per the documentation:

You don't need to add directly to the screen, you can add it to the module itself like the following:

By doing this you don't need to add it manually to all the screens that you are using the component. The Demo i have uploaded is configured like this.

Hope this helps.

Cheers

Pedro please add this to the documentation, I also noticed that for some reason if the script is only on the page (and not on the module) then we also need the JSONviewer script (that is not public on the component) to the page...

Hi André,

Jquery is not included by default in Reactive App. 

1. You must do it manually. from OutsystemsUI



2. Then you create a script that has the code from jquery.json-viewer.js


3. Now you can apply it on the current screen.


Julio.

Julio this method works but if you add the jQuery script to the module (and not just the page, as per Pedro's example below) the JSONviewer script is not needed. At least that is what we found. 

You don't need to add directly to the screen, you can add it to the module itself like the following:

By doing this you don't need to add it manually to all the screens that you are using the component. The Demo i have uploaded is configured like this.

Hope this helps.

Cheers

Pedro please add this to the documentation, I also noticed that for some reason if the script is only on the page (and not on the module) then we also need the JSONviewer script (that is not public on the component) to the page...

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.