Tom Powers
asked on
Load two Images From XML File
I wrote code to get Vistors and Home Team Logos. However the images donot appear here is the code the team name is the logo however one is Visitor and one is home team I donot know how specify the difference. Please Help!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SportsNetwork</title>
</head>
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: "33661.XML",
dataType: "xml",
success: function(data){
var Teams = $(data).find("Team");
var li="",txt="",img = "";
$.each(Teams,function(i,Team) {
Team=$(Team);
li = $("<li/>");
li.append($("<img/>").attr("src","http://images.sportsnetwork.com/MLB/attheballpark/pbp_logos/" + Team.attr("name") + ".png"));
li.append($("<img/>").attr("src","http//images.sportsnetwork.com/MLB/attheballpark/pbp_logos/"+ Team.attr("name").png
//
}
</script>
<body>
</body>
</html>
33661.XML
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I found the code for home team - it is the vh attribute
ASKER