I tired installing this code on alpenami.michiganhotelsguide.com , but to no avail. The company said that I needed to message them in order to activate tracking. I sent them it, and it is still not working, at which point I assumed it was a problem with the code. Any thoughts? I am going through Agoda.com , and all I am used to is HTML, and thus I jsut figured it would snap into place. :

<html>
<head>
<title></title>

</head>
<body>
<div id="SearchBox"> </div>
<script
src="http://
ajaxsearch.partners.agoda.com/partners/Searc
hBox/Scripts/Ago
da.SearchB
oxV2
.
1
.
js" type="text/javascript"></script>
<script type="text/javascript">
var AgodaSearch = new AgodaSearchBox({
cid: 1653026 ,
filterCityName: 'Alpena,Mi',
fixedCityName: true,
fixedCityNameVisible:true,
hotelID: '',
checkInDateBefore:3,
night:2,
language:1,
currencyCode: 'USD',
newWindow: false,
header: '',
footer: '',
style: '
style4
',
Element: 'SearchBox'
});
</script>
<!
--
Default,CmsLanding,Style1, Style2,Style3,
style4,
Style6
--
>
</body>
</html>

Dani AI

Generated

Short summary: the problem turned out to be a broken script URL (line breaks/extra spaces) and a bad style parameter — thanks to for spotting the URL formatting and for reminding to check the console; confirmed the fix. Below are targeted, practical tips so the same issue is easier to diagnose in future installs.

Common pitfalls and quick checks

  • Keep the external script URL intact (no line breaks or stray spaces). Browsers treat those as part of the attribute and the file won’t load.
  • If your site is served over HTTPS, load the partner script over HTTPS (mixed-content will block it).
  • Use DevTools: Network tab to confirm the script returns 200, Console for “undefined” errors (which mean the library didn’t load), and Disable Cache + hard reload when testing.
  • Make sure the placeholder element (the div the widget attaches to) exists and its id matches exactly before you call the vendor init. Case and spelling matter.
  • Ad blockers, strict Content Security Policies, or corporate firewalls can block third‑party partner scripts — test in an incognito window and check network request failures.

Reliable initialization patterns

  • Either place the vendor script tag before your inline init code, or delay your init until the DOM and library are ready. Example (generic wrapper):
    <script>
    document.addEventListener('DOMContentLoaded', function () {
    // run the vendor initialization here, after the DOM is ready
    });
    </script>
  • Another robust approach: add the vendor script dynamically and use its onload callback to run your init (so you know the library actually finished loading).

If it still fails
Collect the Network status code, exact console error text, and a screenshot of the Network request for the script. That information usually shows whether the URL is malformed, blocked, or the wrong protocol — and it’s what partner support will need to finish activation or troubleshoot further.

Recommended Answers

All 3 Replies

You can also use your browser's dev tools (hit F12) and take a look at the console for any errors or other messages that may provide you with a hint of possible problems.

The SRC and the style:'style4' was the issue. Thanks to bost replies :) .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.