Newbie: Custom jQuery in main.js not working

It’s my understanding that custom JavaScript should be included in assets/scripts/main.js

So I added this line to the file below line 21: $( ".menu ul li" ).attr( "class", "col" ); But it’s not working.

Can anyone help me understand what I’m missing?

Thank you.

Custom javascript should be added to the relevant route more than the main.js. Your main.js is your router, it’s purpose is to call the appropriate javascript depending on which page you’re viewing.

I’d say it’s not working cause your file is wrong (you’re not passing your routes object to the router). Check the source here:

@Nicolo_Sacchi he’s using Sage 8, not Sage 9 (which is the main JS you linked)

@s3w47m88 Did you compile your scripts / run gulp?

@ben yes, I’m running gulp watch.

My mistake, pardon, I misread the gist :slight_smile: