I'm creating a NHL Scoreboard that scrolls to left or right. I'm not sure if I'm running into Cross Domain Policy but My computer is in the domain and then I put page on webserver but still the scoreboard didn't appear. I have only one table with Id all set for xml data. So I didn't code for table to repeat ityself for the rest of today's games. And I wanted status at the bottom to be either a hyperlink or button that displays status but when you click pass game id but for now the button click can go on page document.write If you have any experience making tables repeat with different games appear and scroll that would be awesome. I wrote this simple code no Errors but doesn't work.
<!doctype html><html><head><meta charset="utf-8"><title>Untitled Document</title><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script><script type="text/javascript">function loadgames() { var theUrl; theUrl = "http://www.sportsnetwork.com/NHL.xml" $.ajax({ type: "GET", url: theUrl, dataType: "xml", success: function(data){ var d = $(data); d.find('game').each(function(i,game){ var game = $(Game); var id = game.attr("game_id").toLowerCase(); var vteamid = game.attr('vteamid'); var hteamid = game.attr('hteamid'); var vteam = game.attr('vteam'); var hteam = game.attr('hteam'); var vscore = game.attr('vscore'); var hscore = game.attr('hscore'); var status = game.attri('status'); $('#imgvteam').attr('src', 'http://powerzsoftware.com/tsn/Logos/' + id + ".png"); $('#imghteam').attr('src', 'http://powerzsoftware.com/tsn/Logos/' + id + ".png"); $('#txtaway').html(vteam); $('#txthome').html(hteam); $('#txtascore').html(vscore); $('#txthscore').html(hscore); $('#txtstatus').html(status); }); } }); }$(document).ready(function(){ loadgames(); }); </script></head><body><table width="222" border="0"> <tr> <td width="50"><div align="center"><img src="Logos/129.png" name="imgvteam" width="32" height="32" id="imgvteam"></div></td> <td width="155"><div align="center" id="txtaway"></div></td> <td width="32"><div align="center" id="txtascore"></div></td> </tr> <tr> <td><div align="center"><img src="Logos/129.png" alt="" name="imghteam" width="32" height="32" id="imghteam"></div></td> <td><div align="center" id="txthome"></div></td> <td><div align="center" id="txthscore"></div></td> </tr> <tr> <td colspan="3"><div align="center" id="txtstatus"></div></td> </tr></table></body></html>
My Bad I should have saw that one but overall excellent code Chris defines everything in code rather then using a UI Designer. I learned Clone Today which is cool I can add a few new tricks up my sleeve cause of Chris. Thank You.
What up got a ticket for you based on your scores which works awesome now I just need it to marquee like automatic scrolling then repeat when it comes to the end and have status turned into a linkbutton which displays game id when clicked. This one I am clueless can you assist cause your familiar with this ticket. Thanks Chris
Open in new window
Remember, javascript is case sensitive - in your code you pass in game and then try and use GameHave a play with this:
Open in new window