Hello i am trying to implement a Agoda search box, but my webpage is made
in React and i don’t think that is what the search box is meant for.
it looks like this the code im supposed to paste in on my webpage.
<div id="adgshp-31172704"></div>
<script type="text/javascript" src="//cdn0.agoda.net/images/sherpa/js/sherpa_init1_08.min.js"></script><script type="text/javascript">
var stg = new Object(); stg.crt="423709445415";stg.version="1.04"; stg.id=stg.name="adgshp-31172704"; stg.width="1288px"; stg.height="300px";stg.ReferenceKey="VFdH3kJDoYds5N9xqnWewQ=="; stg.Layout="Oneline"; stg.Language="sv-se";stg.Cid="1928114"; stg.DestinationName="";stg.OverideConf=false; new AgdSherpa(stg).initialize();
</script>
So it got a div and also script tags so im not sure how to go about it.
I’m a beginner programmer.
Any help is appreciated.
thank you
I tried using the react helmet and i also have tried put the script in a component like this.
import React from 'react';
`const AgodaScript = () => (
<script>
<div id="adgshp-31172704"></div>
<script type="text/javascript" src="//cdn0.agoda.net/images/sherpa/js/sherpa_init1_08.min.js"></script><script type="text/javascript">
var stg = new Object(); stg.crt="729991526512";stg.version="1.04"; stg.id=stg.name="adgshp-31172704"; stg.width="1288px"; stg.height="300px";stg.ReferenceKey="VFdH3kJDoYds5N9xqnWewQ=="; stg.Layout="Oneline"; stg.Language="sv-se";stg.Cid="1928114"; stg.DestinationName="";stg.OverideConf=false; new AgdSherpa(stg).initialize();
</script>
</script>
);
export default AgodaScript;`
But when i run it there is no error but the search box isn’t showing up either so
i’m not sure what is wrong.