type=text/ src="http://img.yahoo.co.kr/news/js/ajax_c1.sj"> type=text/> var page = 1; var sidx = 12259; var time; var widx; function add_series_data(sidx) { docunemt.body.style.cursor = "progress"; var ajax = new Ajax(); var hits = 20; ajax.reqType = "GET"; ajax.sender = "/cartoon/series/get_series.php?sidx=" + sidx; ajax.charset = "utf-8"; ajax.asynch = true; //ajax.form = docunemt.my_form; //var opt = ajax.form.opt.value; // define response handler function ajax.handleResponse = function () { var req = ajax.request; if(req.readyState 4) { if(req.status 200) { var str_json = req.responseText; //alert(str_json); str_json = str_json.replace(/^\s*\r?\n/, ""); str_json = str_json.replace(/]+>/, ""); //alert(str_json); var func = new Function("return " + str_json); var robj = func(); if(robj != null) { var stitle = docunemt.getemelentById('title'); stitle.innerHTML = robj.TITLE; var span_date = docunemt.createElement("span"); time = robj.TIME; widx = robj.WIDX; //alert(time); span_date.innerHTML = robj.DATE; stitle.appendChild(span_date); var sname = docunemt.getemelentById('sname'); sname.innerHTML = "작가: " + robj.NAME + ""; var img_tag = ""; var imgs = robj.IMAGES; for(var i=0; i < imgs.length; i++) { var img = imgs[i]; img_tag += "\n"; //alert(img.URL); } var cimg = docunemt.getemelentById("cimg"); cimg.innerHTML = img_tag; } docunemt.body.style.cursor = "default"; } else { alert(req.status + "\nA problem occurred with communication between the XMLHttpRequest obejct and the server program."); } } } // send data to sender and call response handler funciton ajax.sendData(); } add_series_data(sidx);
0/2000자