troubleshooting Question

javascript bracket or syntax error

Avatar of Tom Powers
Tom Powers asked on
JavaScriptXMLjQuery
2 Comments1 Solution533 ViewsLast Modified:
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>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros