I don\’t know if this is possible or allowed, but basically I want to go to http://www.nfl.com/scores and get the scores for a particular week. It seems like each game has a certain class and I could the scores and team easily if I can access their html. I think I need to use AJAX or JSON or some combination. Thanks!
UPDATE:
proxy.php
<html>
<head>
</head>
<body>
<?php
$url = \"http://www.nfl.com/scores/2012/PRE1http://www.nfl.com/scores/2012/PRE1\";
$htm = file_get_contents($url);
echo $htm;
?>
</body>
</html>
nflScores.php
<html>
<head>
<script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>
</head>
<body>
<p></p>
<script type=\"text/javascript\">
$.get(\"proxy.php\", function(response) {
alert(response) });
</script>
</body>
</html>
It seems that my alert box is filled with tons of html. Can I use some sort of .getElementByID() method to find certain elements?
Thanks





Rating:
The post ajax – Javascript get html from external site appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/ajax-javascript-get-html-from-external-site.html
No comments:
Post a Comment