How to insert a custom script?

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
rganguly
 
 
Posts: 104
Joined: Sat Feb 12, 2022 1:41 pm

How to insert a custom script?

Post by rganguly »

Hi,

How to insert a custom script in the file? I am using HTML > before </body> but it generates an error because my script starts with a <script> tag and after generating the project this script embeds into index.js and generates an error for the script tag used by me.

Please help ...
Thanks.
Running WYSIWYG Web Builder since 2022...
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: How to insert a custom script?

Post by Pablo »

Where you need to insert the script depends on the script itself.
Without knowing how the script works, it is not possible to say anything meaningful about this.
User avatar
rganguly
 
 
Posts: 104
Joined: Sat Feb 12, 2022 1:41 pm

Re: How to insert a custom script?

Post by rganguly »

Pablo wrote: Wed Jan 11, 2023 3:16 pm Where you need to insert the script depends on the script itself.
Without knowing how the script works, it is not possible to say anything meaningful about this.
The script is for Jornaya, and as per them, this script should be inserted before closing the body tag.
Running WYSIWYG Web Builder since 2022...
User avatar
rganguly
 
 
Posts: 104
Joined: Sat Feb 12, 2022 1:41 pm

Re: How to insert a custom script?

Post by rganguly »

When I try to add before </body> tag using page HTML, it generates this error: " Uncaught SyntaxError: Unexpected token '<' " because of the script tag
Running WYSIWYG Web Builder since 2022...
User avatar
rganguly
 
 
Posts: 104
Joined: Sat Feb 12, 2022 1:41 pm

Re: How to insert a custom script?

Post by rganguly »

Running WYSIWYG Web Builder since 2022...
User avatar
rganguly
 
 
Posts: 104
Joined: Sat Feb 12, 2022 1:41 pm

Re: How to insert a custom script?

Post by rganguly »

Please help ...
Running WYSIWYG Web Builder since 2022...
User avatar
crispy68
 
 
Posts: 2913
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: How to insert a custom script?

Post by crispy68 »

Are you sure you are entering the script correctly into WB?

I don't believe a <script> tag should not be in a separate .js file like your image. The <script> tag should only be in the html portion referencing the function in your .js file.

What does the original script look like that you are inserting?
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: How to insert a custom script?

Post by Pablo »

You can control the HTML/Javascript output in Tools -> Options -> HTML
If you do not want the code to be placed in an external js file then uncheck 'Generate external JS file'

Note that we cannot give support on third party code. But if you leave all HTML output on their default then the code will be inserted "AS IS".
Post Reply