Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Adding java script in a widget WordPress



I want to add the below java script code to my sidebar at

How can I make it work in a widget?
It doesn´t work when I try with the following plugins: HTnl Java script Adder


<div id="SearchBox"> </div>
<script src=" da.SearchBoxV2.js" type="text/javascript"></script>
<script type="text/javascript">
var AgodaSearch = new AgodaSearchBox({
cid: 1410906, filterCityName: '', fixedCityName: false, fixedCityNameVisible:true, hotelID: '', checkInDateBefore:3, night:2,
language:25, currencyCode: 'SEK', newWindow: false, header: '',
footer: '',
style: 'CMSLanding, Element: 'SearchBox'
}); </script>

Answers (1)


Christianto answers:

Hi Charlotte,

In your site, I saw error on your site because script not loaded correctly,
there are space on your script src url, on "/Ago da" da.SearchBoxV2.js
you can remove the space it to see if it work..

also I see error here, some parameter missing apostrophe (') on its value and some need to be inside apostrophe

please try use this code on widget:
[[LINK href=""]][[/LINK]]

Charlotte Raboff comments:

Thanks! It worked :-)