Link to home
Start Free TrialLog in
Avatar of Tom Powers
Tom Powers

asked on

javascript bracket or syntax error

I have a bracket issue or syntax error Please help

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>The Sports Network</title>
<style type="text/css">
.tablecolor {
	background-image: url(Greywall.png);
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
 var xmlPath = '.'; // '/xml/nfl/scores/real';
  var xmlGameID = 'AB-3171'; // game id only, _counter.xml will be added in the ajax call
  var counterXml = 0;
  
   
  // check extension, include path if needed

 function loadData()
{
  $.ajax({
  
    type: "GET",
    url: xmlPath + "/" + xmlGameID + '_' + counterXml + ".xml",
    dataType: "xml",
    success: function (data)
    {
      var d = $(data);
      var Play = d.find('Play');
      
    // if ($(Team).attr('ID') == $(Play).attr('DefID')) {
		//  var Team = Team.attr('name') ;
        //    $('#Team').html(Team);
	// }
	    d.find('Team').each(function(i,Team){
        if ($(Team).attr('vh') == "A") {
			if ($(Team).attr('ID') == $(Play).attr('DefID')) {
	
      var Individual_Statistics = d.find('Individual_Statistics[IS_TeamID="' + TeamDefID + '"]');
	  
		$('#imgDL').attr('src', ('http://images.sportsnetwork.com/nfl/atthegridiron/end_zone/'+$(Play).attr('DefID')+"_helmet_away.png");	
		
		
			}
		}
		}
		
		
		d.find('Team').each(function(i,Team){
        if ($(Team).attr('vh') == "H") {
			if ($(Team).attr('ID') == $(Play).attr('DefID')) {
	
      var Individual_Statistics = d.find('Individual_Statistics[IS_TeamID="' + TeamDefID + '"]');
     
			$('#imgDL').attr('src', ('http://images.sportsnetwork.com/nfl/atthegridiron/end_zone/'+$(Play).attr('DefID')+"_helmet_home.png"));
        //  var idselector = arrIDs[AllStats.nodeName].id;
       //   var nodeStart = arrIDs[AllStats.nodeName].start; // AllStats.nodeName.substr(0, AllStats.nodeName.length - 5); // need the part before Stats
			}
		}
		});
		
         // $(AllStats).find(Defense + '_Listing').each(function(i2, Defense_Listing){
             $(Defense_Listing).find(Defense + '_PlayerID').text() 
            
              var Firstname = $(Defense_Listing).find('_Firstname').text();
              var Lastname = $(Defense_Listing).find('_Lastname').text();
              $('#Playername').html(Firstname + ' ' + Lastname);
            //  switch (nodeStart)
              //{
              //  case "Defense":
                  
 
              
              
			
           // each xxx_Listing
		
     
      ++counterXml;
    }
  }); //ajax
}

  </script>
</head>

<body>
<table width="800" border="1" class="tablecolor">
  <tr>
    <td width="114" rowspan="4" bgcolor="#FFFFFF"><p align="center"><img src="DL.png" name="imgDL" width="85" height="102" id="imgDL"></p></td>
    <td width="123"><div align="center">Tackles</div></td>
    <td width="122"><div align="center">Assists</div></td>
    <td width="152"><div align="center">Combined</div></td>
    <td width="136"><div align="center" id="Sacks">Sacks</div></td>
    <td width="127"><div align="center">Sack_Yards</div></td>
  </tr>
  <tr>
    <td><div align="center" id="Tackles">Tackles</div></td>
    <td><div align="center" id="Assists">Assists</div></td>
    <td><div align="center" id="Combined">Combined</div></td>
    <td><div align="center" id="Sacks">Sacks</div></td>
    <td><div align="center" id="Sack_Yards">Sack_Yards</div></td>
  </tr>
  <tr>
    <td><div align="center">Interceptions</div></td>
    <td><div align="center">Pass_Deflections</div></td>
    <td><div align="center">Forced_Fumbles</div></td>
    <td><div align="center">Fumbles_Recovered</div></td>
    <td><div align="center">Safties</div></td>
  </tr>
  <tr>
    <td><div align="center" id="Interceptions">Interceptions</div></td>
    <td><div align="center">
      <div align="center" id="Pass_Deflections">Pass_Deflections</div>
    </div></td>
    <td><div align="center" id="Forced_Fumbles">Forced_Fumbles</div></td>
    <td><div align="center" id="Fumbles_Recovered">Fumbles_Recovered</div></td>
    <td><div align="center" id="Safties">Safties</div></td>
  </tr>
  <tr>
    <td id="PlayerName"><div align="center" id="PlayerName">PlayerName</div></td>
    <td colspan="5"><div align="center" id="Team">Team</div></td>
  </tr>
</table>
<script>
var myVar=setInterval(function(){myTimer()},1000);

function myTimer()
{

loadData();
//checkStatus();
}
</script>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Powers
Tom Powers

ASKER

Thanks Gary I have atough time coming from VB to javascript with all the } and stuff.