【发布时间】:2018-01-18 10:00:07
【问题描述】:
我有一个页面....http://kingola.com/test.html 我正在为我的移动应用程序工作,但由于某种原因,图像没有显示在我的 Android 移动浏览器上,但我在我的 Firefox 上看到它马克。
另外...由于某种原因,它在 IE 中不起作用。
代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<title>Reading XML with jQuery</title>
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: "http://kingola.com/podcast/",
dataType: "xml",
success: function(xml) {
$(xml).find('item').each(function(){
// var id = $(this).attr('guid');
var title = $(this).find('title').text();
var url = $(this).find("enclosure").attr('url');
var description = $(this).find('description').text();
var img = $(this).find("itunes\\:image").attr('href');
$('<div class="items" id="link_"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');
$('<div class="brief"></div>').html(description).appendTo('#page-wrap');
$('<div class="image"></div>').html('<img src="'+img+'">').appendTo('#page-wrap');
$('<div class="ima-link"></div>').html(img).appendTo('#page-wrap');
});
}
});
});
</script>
</head>
<body>
<div id="page-wrap">
<h1>Reading XML with jQuery</h1>
</div>
</body>
</html>
【问题讨论】:
-
图片不显示是什么意思?是图像根本没有加载还是它已经加载但图像源被破坏了?当我看到您的演示时,Chrome Mac 中没有加载任何图像。
-
图片不显示。它应该被加载。在火狐上测试看看。
-
让它工作。多谢你们。这有帮助。 stackoverflow.com/questions/9625487/…
标签: javascript html css mobile web