Uncaught TypeError: Cannot call method 'call' of undefined
Hi, I have a script which connects to a yahoo pipe, to fetch the latest video from a particular user on youtube, and retrieve the unique string which identifies that video, then pump this into an object that should load the video. However, the video does not load, and on 'inspect element' this error comes up - Uncaught TypeError: Cannot call method 'call' of undefined, in the jquery.min file, here is the script:
Code:
<html><head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
</script>
<script type="text/javascript">
//Routine to display the items of an RSS feed in a web page
// The output is attached to a uniquely identified HTML item
// The URL of the RSS feed you want to display
var url='http://gdata.youtube.com/feeds/api/users/charizardthree/uploads?orderby=updated';
//The id of the HTML element you want to contain the displayed feed
var containerID="test";
//------------------------------------------------------
// The gubbins...
function cross_domain_JSON_call(url){
// url points to an RSS feed
url="http://pipes.yahoo.com/ouseful/proxy?url="+encodeURIComponent(url)+"&_render=json&_callback=?";
// displayOutput(url);
//fetch the feed from the address specified in 'url'
// then call "myCallbackFunction" with the resulting feed items
$.getJSON(
url,
function(data) { myCallbackFunction(data.value.items); }
)
}
// A simple utility function to display the title of the feed items
function displayOutput(txt){
$('#'+containerID).append(txt);
}
function myCallbackFunction(items){
// 'items' contains the separate feed items;
// 'title' contains the item title, 'link' the url, 'description' the main text
// Run through each item in the feed and print out its title
//for (var i=0; i < items.length; i++){
var link = (items[0].link);
var txt = '<object style="height: 480px; width: 660px"><param name="movie" value="'+link+'"?version=3&feature=player_profilepage"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="'+link+'"?version=3&feature=player_profilepage" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="660" height="480"></object>';
//displayOutput(txt);
document.getElementById('test').innerHTML = txt;
alert(txt);
//}
// You could easily call 'myArbitraryCallbackFunction(items)" from this function
}
// Tell JQuery to call the feed loader when the page is all loaded
$(document).ready(cross_domain_JSON_call(url));
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>
Bookmarks