Javascript navigation not working 100% after AJAX scripts added to page

Mark B
Mark B used Ask the Experts™
Hi- I am reworking an email form that was using server side script to client side. The issue, is that the Javascript navigation does not working correctly with the new Ajax scripts added to page, but if you hit refresh in browser, then the navigation seems to work ok. I am thinking perhaps there is a need to force reload the javascript after the new ajax based scripts load.

The page is here:

The new Ajax code added to the page is here (and we should not alter this vendor supplied code:

<!-- XMPL library -->
<script type="text/javascript" src=""></script>
<link type="text/css" href="" rel="stylesheet" media="screen" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link rel="stylesheet" type="text/css" href="" />
<!-- XMPL library -->

Open in new window

The javascript that manages the navigation style is here:

Attached are two screens. One shows how the navigation is not wide enough on page load / before refresh. The other screen shows how the navigation should look / after refresh.

I've tried moving the scripts around in the header, putting them after the body, added defer or async to the javascript lines. If there is a change to main092718.js, that is possible for us to add, but the other ajax scripts, we cannot change.

Is there some way to force the main092718.js to re initialize after ajax scripts or is there something to change in main092718.js? main092718.js has been working forever ok, but the addition of the new scripts has caused issues. Thank you for any direction.  Mark
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ste5anSenior Developer

You're the initPage() method in your original JS navigation is not called directly in your page code.-.

Using Chrome right click / Inspect and check errors in console this will point you the problem.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial