
$(function(){
		var topicList = $("<ul></ul>").appendTo("#itnews_field");
		
		//Ajax処理ここから
		$.ajax({
			url: "./itnews/index.php",
			cache: false,
			type: "GET",
			dataType: "xml",
			timeout:6000,
			beforeSend: function(xml){
				$("<ll class='first'>データを読み込んでいます...</li>").appendTo(topicList);
			},
			error: function(){
				$(topicList).empty();
				$("<li class='first'>データを取得できませんでした。</li>").appendTo(topicList);
			},
						
			success: function(xml){
				topicList.empty();
				$(xml).find("topic").each(function(){
				//console.log($(this).length)
					var TITLE = $(this).children("title").text();
					var LINK = $(this).children("link").text();
										
					var TOPIC = $("<a href= '" + LINK + "' target='_blank'>" + TITLE + "</a>");

					$("<li></li>").html(TOPIC).appendTo(topicList);
				});
				$("li:first", topicList).addClass("first");
			}	//success
		});	//Ajax
	   
});