感谢所有常客贡献者。
以下是返回“无效标签:for”title“。在谷歌(ing)之后这不是一个不常见的错误,但在下面的背景下,我很难找到解决方案。此外, 如果查询发生变化,可以在GET查询中强加限制:
url : 'http://www.deanclatworthy.com/imdb/?year=1996 LIMIT 10,
错误:标签无效源文件: http://www.deanclatworthy.com/imdb/?q=Star+Trek&callback=jsonp1313962790639 行:1,列:1
--------------完整代码----------------
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
</head>
<body>
<div id="Movies"></div>
<script>
$.ajax({
type : 'GET',
dataType : 'jsonp',
url : 'http://www.deanclatworthy.com/imdb/?q=Star+Trek',
success : function(Movies) {
var movie = $.map(Movies.results, function(obj, index) {
return {mTitle:obj.title, mGenres:obj.genres, mDate:obj.year, mURL : obj.imdburl, mRating : obj.rating};
});
$('#Movies').appendTo('#movies');
}
});
</script>
</body>
</html>