How to use javascript


I have created the javascript file, but how do I include it in the body of my html?

You don't need to, when you export the files it will be referenced then

I have a custom script in a test site I'm using on to learn BSS, when I export or publish the site my script is placed before jquery is called and the script won't run. If I manually move the script so that it's after the jquery call then it works. I'm just starting to learn to use BSS so may well be missing a setting or doing something wrong, any help appreciated. Here is a clip of this section of my index.html:

<script src=""></script>

<script> $(document) .ready(function () { function filterPath(string) { return string .replace(/^\//, '') .replace(/(index|default).[a-zA-Z]{3,4}$/, '') .replace(/\/$/, ''); } $('a[href*=#]') .each(function () { if (filterPath(location.pathname) == filterPath(this.pathname) && location.hostname == this.hostname && this.hash.replace(/#/, '')) { var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) + ']'); var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false; if ($target) { var targetOffset = $target .offset() .top; $(this).click(function () { $('html, body').animate({ scrollTop: targetOffset }, 2000); return false; }); } } }); }); </script>

<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.singlePageNav.js"></script>


There's no jquery 1.5.2 in BSS, so i suppose you're adding that to your design. But you don't need to do so, BSS already adds jquery support for you. So all you need is right click in the design pane over " > JavaScrit" and select Create JS so that you can paste your script in an external files that will be called after jquery.

Sorry to resurrect an old post.

I Was reading through it to try to solve a similar problem. I have a custom JavaSCript file to run some script on a certain page. In preview it works fine but the moment i Publish it it doesn't work at all (seems like it doesn't read the JS file).

How do i fix this??