Javascript loading issues

Hi All,



Hopefully someone can help with this problem as it’s been bugging me all day lol



I am trying to get a dropdown list that is populated on page load, when the first dropdown box has a selection made it then populates a second dropdown box… quite simple and I used to have this running on my old 1.3.5 cart very well, but on the upgrade route somewhere along the line it stopped working and I decided to remove it.



I used to be able to call the js in the body tag like so


<body onload="fillCategory();">
```<br />
<br />
and I think I saw an explanation as to why this would no longer work on CS-Cart a couple of years ago.<br />
<br />
<br />
Now I would like to put it back on and use it in my new V3.0.6 cart, I have tried several different techniques that are supposed to load js without using the body option such as:<br />
<br />
```php
window.onload = fillCategory;
```<br />
<br />
and<br />
<br />
```php
window.onload = fillCategory();
```<br />
<br />
because there's conflicting opinions on whether the () are needed... grrr<br />
<br />
Now I believe window.onload is deprecated and there are other newer options but I cannot really understand any of the tuts, been a long time since I did any real coding and my head hurts these days lol, anyone have a fairly easy example of how I could get this to work please?<br />
<br />
<br />
TIA<br />
Mark

Nevermind, you can still use onload in the body :confused:



My problem was to do with my jump script being written in php I believe, I have now converted it to javascript and it seems to be working just fine :)