0

How do I load the web3 module into the frontend of my application using the html script element?

I have already installed the web3 module using npm. This is the path to the web3 module in my app directory.

../node_modules/web3/

I uploaded the require.js module in the following way using the script element:

script data-main="app" src="node_modules/requirejs/require.js"></script>

What is the correct file path to use when I am attempting to upload the web3 module using the script element and src attribute? I do not know which filepath is the correct one to load.

0

You can use this:

<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.36/dist/web3.min.js" integrity="sha256-nWBTbvxhJgjslRyuAKJHK+XcZPlCnmIAAMixz6EefVk=" crossorigin="anonymous"></script>

you can search for a more recent version in cnd: https://www.jsdelivr.com/package/npm/web3

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.