Hello, I'm new using nicepage, I have a custom javascript code that I want to run,
it works if I copy the entire code in the HTML element, but I want to reference the javascript file that is hosted in another public server, is this possible ?
Example, this works:
<script type="text/javascript"> function msg(){ alert("Hello Javascript");} </script>
<script>msg();</script>
but the following code does not work, the message function is in a .js file on another server
<script type="text/javascript" src="http://customserver.com/public/script/jsfunctions.js"></script>
<script>msg();</script>
the file jsfunctions.js has the code:
function msg(){ alert("Hello Javascript"); }
The HTML element is in section of the body of the page.
when I see the source code of the page generated by nicepage, I see the reference to the src external localtion, if I click the scr URL, the browser displays the .js file contents. the .js file is not blocked.
Is there any addtional configuration for nicepage to load the javascript code from the external server?
We prefer to have the javascript code referenced from external file as the code might change and we only need to change it on the external file and no need to edit or modified the web site page already generated by nicepage
Thank you,
C.j.
Hello, I'm new using nicepage, I have a custom javascript code that I want to run, it works if I copy the entire code in the HTML element, but I want to reference the javascript file that is hosted in another public server, is this possible ? Example, this works: <script type="text/javascript"> function msg(){ alert("Hello Javascript");} </script> <script>msg();</script> but the following code does not work, the message function is in a .js file on another server <script type="text/javascript" src="http://customserver.com/public/script/jsfunctions.js"></script> <script>msg();</script> the file jsfunctions.js has the code: function msg(){ alert("Hello Javascript"); } The HTML element is in section of the body of the page. when I see the source code of the page generated by nicepage, I see the reference to the src external localtion, if I click the scr URL, the browser displays the .js file contents. the .js file is not blocked. Is there any addtional configuration for nicepage to load the javascript code from the external server? We prefer to have the javascript code referenced from external file as the code might change and we only need to change it on the external file and no need to edit or modified the web site page already generated by nicepage Thank you, C.j.