External Js File Not Working In React
After building the project and deploying it the script gets inserted but only works someti.
External js file not working in react. I ve tried react helmet to only get the same result. The js file was there it was in the same directory but the content of the file was memory cached in the browser. The part i commented out in the js file was the previous method i was trying to use. I would rather have my code defined in an external file so getting it to work that way would be ideal.
Initially my js file was empty as i began testing the html structure. Fyi i am using visual studio 2008 professional and i am working with an asp net web application. If your html file is in what we will call your root folder and the js file is indeed in the scripts folder relative to where the html file is located but it isn t working the. The externals configuration option provides a way of excluding dependencies from the output bundles.
Instead the created bundle relies on that dependency to be present in the consumer s any end user application environment. This feature is typically most useful to library developers however there are a variety of applications for it. Later when i added code to the js file the browser window which had been open did not re read the js file even after refreshing the browser. However for some reason it does not work i tried the same function and commands inline and it worked but not when it s using an external javascript file.
I m trying to use an external javascript file in order to write hello world into a html page. All the css are working fine but the javascript libraries are not working on the page.