We help IT Professionals succeed at work.
Get Started

Jquery xml auto scroller with reload content at end

benandbecky
benandbecky asked
on
835 Views
Last Modified: 2013-11-05
I really need a auto scroller that pulls from an xml file, but on feature nobody has is to refresh the xml at the end of the run so that any updates will be posted.

Here is what i want in flash (doesn't refresh though): http://www.usflashmap.com/component/flash_news_scroller.htm

Here is the xml reader i have:

How would i make this auto scroll and restart the cycle (load xml file again)?

THanks so much!!!
Ben
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" media="all" href="style.css" />
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="scroll.js"></script>
	<title>Reading XML with jQuery</title>
     <script>
     	$(document).ready(function(){
			$.ajax({
				type: "GET",
				url: "http://grrapiap187/dashboard.3/ChangeScroller/sites.xml",
				dataType: "xml",
				success: function(xml) {
					$(xml).find('site').each(function(){
						var id = $(this).attr('id');
						var title = $(this).find('title').text();
						var url = $(this).find('url').text();
						$('<div class="items" id="link_'+id+'"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');
						$(this).find('desc').each(function(){
							var brief = $(this).find('brief').text();
							var long = $(this).find('long').text();
							$('<div class="brief"></div>').html(brief).appendTo('#link_'+id);
							$('<div class="long"></div>').html(long).appendTo('#link_'+id);
						});
					});
				}
			});
		});
     </script>
</head>
<body>
	<div id="page-wrap">
     	<h1>Reading XML with jQuery</h1>
     </div>
</body>
</html>

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE