Newbir Javascript woes

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
8/10/2011 7:10:13 AM
Gravatar
Total Posts 116

Newbie Javascript woes

Hi all,

I wanted to make my first foray into getting some custom javascript working in mojoportal - specifically scrollable - http://flowplayer.org/tools/demos/scrollable/index.html

As I wanted the easiest possible way as a starting point I added 

<!-- include the Tools -->
<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
  
<!-- standalone page styling (can be removed) -->
<link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/standalone.css"/>
  <link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/scrollable-horizontal.css" />
<link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/scrollable-buttons.css" />

to the head section of the layout.master and then the css from the flowplayer page and the html and javascript into a html module on a test page - it all looks OK but the functionality doesn't work - am I doing something wrong?

The test page I was using is here http://dev2.jrcwebsolutions.co.uk/test-page.aspx and the version of mojoportal is 2.3.5.5 SqlCe (haven't updated this dev site yet) and its running on windows 2003 if that makes any difference?

Once I can get past this intro hurdle what is the better way (but still not too complex yet) of including additional js functionality in mojo sites - can I just add a .js file into the skin and link to it from the layout.master as a preferred method?

Thanks

Andrew

 

 

8/10/2011 9:44:32 AM
Gravatar
Total Posts 115
mojoPortal Community Expert

Re: Newbir Javascript woes

In looking at you site I would say moving the int script to the header should get you up and running.

8/10/2011 10:07:22 AM
Gravatar
Total Posts 116

Re: Newbir Javascript woes

Hi Aaron, thanks for the input, I've tried that but it doesn't seem to have made any difference.  Also tried commenting out the <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script> part just to see and that didn't seem to change anything either....... have also removed the init script from the html module at the moment....

8/10/2011 10:46:19 AM
Gravatar
Total Posts 115
mojoPortal Community Expert

Re: Newbir Javascript woes

Taking a closer look at your page I can see from the page source that the Jquery is not being loaded in the <head> tag but in the <body> tag. I am not sure why it would be doing that but that is probably why it is not firing.

8/10/2011 10:58:13 AM
Gravatar
Total Posts 116

Re: Newbir Javascript woes

Thanks Aaron that gave me a big clue and something else to try smiley

I copied the whole lot of javascript and css links into the master page just before the </body> and it works fine on the test page now just need to neaten it up a bit and then start making it do what I actually want it to instead of just getting it to work so I think I'm kinda over the first hurdle.......

Having said that I'd still like to know a better way of doing it as I'm sure this wouldn't be the recommended way??

Thanks for your help in getting it up and running

Andrew

8/10/2011 10:59:20 AM
Gravatar
Total Posts 18439

Re: Newbir Javascript woes

upgrading to the latest mojoPortal should solve it because recent versions do load jQuery in the head. 2.3.5.5 is an old version released about 10 months ago which is a long time in the mojoPortal world. Otherwise I would suggest adding the custom scripts closer to the bottom of layout.master.

Hope that helps,

Joe

8/10/2011 3:39:00 PM
Gravatar
Total Posts 116

Re: Newbir Javascript woes

Hi Joe,

Thanks for confirming - started out as a "quick and easy" test to make sure it worked as I thought really, was going to update the site and flatten it to start building a new site as the next step laugh

Cheers

Andrew

You must sign in to post in the forums. This thread is closed to new posts.