I have a script with jQuery and I want to use it inside my gatsby react page. So first I Created a file in my project nestpay.js and I paste the script content inside it like that:
function submitformpaiement()
{
// code here
}
Second I added const payScript = require('../pages/nestpay') inside render()
render() {
const payScript = require('../pages/nestpay')
return (
<Layout>
<Helmet title="donation" />
<Nav />
<div id="main">
</div>
</Layout>
)
}
and when I run the project I got tons of syntax errors in my nestpay.js file.
./src/pages/nestpay.js Module Error (from ./node_modules/eslint-loader/index.js):
C:\Users\PREDATOR\Desktop\gatsby\ticketsadaka\src\pages\nestpay.js
205:19 warning Unexpected mix of '>>>' and '|'
no-mixed-operators 205:25 warning Unexpected mix of '>>>' and '|' no-mixed-operators 216:3 error 'strlen' is not defined
no-undef 219:7 error 'strlen' is not defined
no-undef 219:37 error 'strlen' is not defined
no-undef 220:10 error 'strlen' is not defined
no-undef 220:45 error 'strlen' is not defined
no-undef 222:12 warning 'i' is already defined
no-redeclare 232:14 warning 'j' is already defined
no-redeclare 262:12 warning 'i' is already defined
no-redeclare
I think I miss something in that file a header or an import I don't know what.
I test that script in an HTML page and it's work fine so I need your help how to use it inside gatsby react page.
Thanks in advance ;)
