I am a tester in configuration manager by profession so I know a bit about code, but I am not a developer. I can write batch and shell scripts and I am good with markup languages, but I know very little about javascript. I guess I know just enough to be dangerous. But I am trying to learn and all help will be greatly appreciated.
I have searched for an answer to this on the forum, but couldn't find anything I could understand.
I am trying to integrate a jquery script called livetwitter into a Joomla template called Iridium by RocketTheme. The Joomla template uses mootools which I understand is a different framework.
I have read that there are several hacks and plugins you can use with joomla to allow jquery to run. However, I dont understand what I must change to the call in the html to the jquery script. This is how the call from the developers site looks:
Now I *think* with my dangerously small amount of knowledge that the problem is something to do with that "$" and the wrong javascript library being loaded... and that I need to specify a call to the jquery library.
The livetwitter script lives in the /js folder and is called jquery.livetwitter.js
I have emailed the author of the livetwitter scipt for advice, and been through the comments and docs for every jquery joomla plugin. None of them explain how I must change the above commands.
I hope that explains the situation and problem I am having. All help greatly appreciated.
<code>
<!-- Begin twittersearch -->
<div id="twitterSearch"></div>
<script type="text/javascript">
<script src="/js/jquery.livetwitter.min.js"></script>
<script src="/js/jquery.livetwitter.js"></script>
jQuery.noConflict(); <!-- suggested hack to force the following to use jquery -->
$('#twitterSearch').liveTwitter('bacon', {limit: 5, rate: 5000});
$('#twitterUserTimeline').liveTwitter('elektronaut', {limit: 5, refresh:
</script>
<!-- End twittersearch -->
</code>
....... ???
I have done that, and there is no noticeable change to the page.
I'm not sure about joomla, but I had similar problems using JQuery in DotNetNuke.
Step 2: Initialize jQuery
DNN has name conflict issues with jQuery so the following line is needed (thanks to Steve Johnson at Abstract Coder for this tidbit):
var $j = jQuery.noConflict();
I included this in my utilities.js file outside of any functions.
Step 3: Call jQuery Functions
It is important to note that all of your calls to jQuery functions will use this $j variable instead of the normal, single $ you will find documented just about everywhere. So for example, the document ready function will look like this:
$j(document).ready(function() {
//your code here
});
Now you can write your normal javascript code and call jQuery functions throughout. Just remember to use the $j variable.
Bookmarks