Odoo Help


Javascript loaded into website.assets_frontend only working on homepage not internal "pages" <<Solved>>

KD Curry
on 5/10/15, 6:09 PM 2,333 views

 I've created a custom theme module and have set up some javascript to handle hiding a utility bar that hides on scrolling.

I've installed the script in my theme/static/src/js folder  and created a my_theme.xml file in my views folder to add the script to the website.assets_frontend.

The script works great on the homepage - but stops working when you load the other pages (pages/contact_us, hello, etc). I can still see the script on all pages when I do a view source.

I'll insert a copy of the my_theme.xml and navbar.js



<?xml version="1.0" encoding="utf-8"?>



<template id="kdc_assets_frontend" inherit_id="website.assets_frontend" name="Sightac KDC Front End Assets">

<xpath expr="." position="inside">

<script src="/sightac_kdc/static/src/js/navbar.js"></script>






$(window).scroll(function() {

if ($(".navbar").offset().top > 50) {



} else {





KD Curry
On 5/10/15, 10:44 PM

OK. Mystery solved. The home page includes a snippet that also run some script to manipulate a canvas. The internal pages don't have this snippet, which triggered a script error. All javascript stopped at that point including my navbar script.

Could you please provide some more information on how you solved it then? Did you call the snippet for other pages or...

Pieter Paulussen
on 7/5/16, 5:05 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/10/15, 6:09 PM
Seen: 2333 times
Last updated: 7/5/16, 4:10 AM