Hi all,
I am using an old and pre-made plugin that simply displays a Tweet. The issue is this line:
holder.append("<p>"+item.text.makeLinks()+"</p>");
I am assuming that the makeLinks() turns any links in the tweet to actual, clickable links. But when I run it I get the error:
If I remove the makeLinks() it works fine.
Can anyone help me identify what makeLinks() actual does and how to solve this error?
Thanks heaps!
The rest of the code is:
<script type="text/javascript" charset="utf-8" src="js/jquery-1.7.2.js"></script>
<!--TWITTERFEED-->
<script type="text/javascript" charset="utf-8" src="js/twitterrize.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
//Calling Twitterize - Assigning to Element and User
$('#tweets').twitterize('mbffbrisbane');
});
</script><!--END TWITTERFEED-->
- (function($){
//Creating Function called Twitterize
$.fn.twitterize = function(username,options){
//check to see if the username has been set.
if (username){
//create an object full of default settings.
var defaultSettings = {
count:'1'
}
// Finds which default settings have been overwritten by the options object
// and creates a new object with all the new and untouched settings.
var settings = $.extend(defaultSettings, options);
// The URL for the Twitter JSON API.
var url = "http://twitter.com/status/user_timeline/"+username+".json?count="+settings.count+"&callback=?";
//Variable to get around scope problem in callback function.
var holder = this;
//Contact Twitter
$.getJSON(url,
//This function is called when twitter responds with the appropriate information.
function(data){
//Step through each tweet.
$.each(data, function(i, item) {
//place the tweet within a paragraph tag within the main div.
holder.append("<p>"+item.text.makeLinks()+"</p>");
});
});
}
else{
//Username paramater has not been set.
console.debug("jquery plugin twitterize requires a username! Check your parameters");
}
//Return itself
return this;
};//END TWITTERIZE
})(jQuery);