点击回首页
我的浏览记录 | | 帮助?
当前位置:

源码截图

源码目录树

当前路径:LetSearch/js/default.js     // JScript source code
//dxt 2007-03-10
var CityCode;
var sports_news,sports_news,rssUrl_sports,newsCount_sports,if_pubDate_sports;
var ElseNews_news,ElseNews_news,rssUrl_ElseNews,newsCount_ElseNews;


function init()
{
    CityCode=getcookie("Dxt_Weather");
    Start_Drag();
    GetWeather();           //获得天气预报
    GetGhost();             //鬼故事
    GetTianyaNewsInfo();        //天涯新闻
    GetNews_Sports();       //体育新闻
    GetPics();
    GetVideo();                 //获得视频文件
    GetHouseInfo();             //获得房产信息
    Get163NewsInfo();           //采集网易新闻
    GetMopNewsInfo();           //采集猫扑新闻

}

//获得天气预报
function GetWeather(theCityCode)
{
    if(!CityCode && !theCityCode) CityCode="144";
    if(theCityCode)
    {
         CityCode = theCityCode;
    }
    
    setcookie("Dxt_Weather",CityCode,12);
    $("selectCityWeather").style.display = "none"; 
    $("weather_content").children[1].innerHTML = "<center><img src='Images/inprogress.gif' /></center>";

    var option={
        parameters:"t=weather&CityCode="+CityCode,
        method:"get",
		onSuccess:function(transport){
			var rp=transport.responseText;
			var doc=new X2Doc(rp);
			var result=doc.root.getValue("Result");
            if(result=="OK")
            {
                var weather = "<ul class='weather'>";
                weather += "<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#e1671c'><b>"+doc.root.getValue("City")+"</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+doc.root.getValue("TodayWeather")+"</li>";
                weather += "<li><img src='Images/Weather/WenDu.gif' alt='温度' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+doc.root.getValue("WenDu")+"</li>";
                weather += "<li><img src='Images/Weather/FengLi.gif' alt='风力' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+doc.root.getValue("FengLi")+"</li>";
                weather += "<li><img src='Images/Weather/ZiWaiXian.gif' alt='紫外线' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+doc.root.getValue("ZiWaiXian")+"</li>";
                weather += "<li><img src='Images/Weather/KongQi.gif' alt='空气' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+doc.root.getValue("KongQi")+"</li>";
                weather += "</ul>";
			   $("weather_content").children[1].innerHTML = weather;
			 }
			 else 
			 {
			    $("weather_content").children[1].innerHTML = "数据获取失败,请检查网络或重试。";
			 }
			 $("weather_title_2").children[0].src="Images/refresh.gif";
        },
        onFailure:function(transport)
        {
            $("weather_content").children[1].innerHTML="数据获取失败,请检查网络或重试。";
            $("weather_title_2").children[0].src="Images/refresh.gif";
        }
    }
    
    var request=new Ajax.Request("ajax.aspx",option);
}

//刷新天气
function RefreshWeather()
{
    $("weather_title_2").children[0].src="Images/indicator2.gif";
    GetWeather(); 
}

//修改天气预报城市
function EditCityWeather()
{
     InitProvince("Weather_ProvinceList");
     if($("selectCityWeather").style.display == "none")
     {
        $("selectCityWeather").style.display = "block";

     }
     else
     {
        $("selectCityWeather").style.display = "none";
     }    
}

//获得每日饮食黄历
function GetFood()
{
    $("food_content").children[0].innerHTML = "<center><img src='Images/inprogress.gif' /></center>";
    var option={
        parameters:"t=food",
        method:"get",
		onSuccess:function(transport){
		    var rp = transport.responseText;
		    if(rp!="Flase")
		    {
		        $("food_content").children[0].innerHTML = rp;
		    }
		    else
		    {
		        $("food_content").children[0].innerHTML = "数据获取失败,请检查网络或重试。";
		    }
		},
		onFailure:function(){
			 $("food_content").children[0].innerHTML = "数据获取失败,请检查网络或重试。";	    
		}
    }
    
    var request=new Ajax.Request("ajax.aspx",option);
}



//获得体育新闻
function GetNews_Sports(rssUrl,num)
{    
    if(!rssUrl && !num)
    {
        var cookie_news_sports = getcookie("sports_content");
        rssUrl_sports=cookie_news_sports.split('|')[0];
        newsCount_sports=cookie_news_sports.split('|')[1];
        if_pubDate_sports=cookie_news_sports.split('|')[2];

        if(!rssUrl_sports && !newsCount_sports)
        {
            rssUrl_sports = "http://rss.sina.com.cn/sports/basketball/focus.xml";
            newsCount_sports=6;
            if_pubDate_sports=0;
        }
            
    }
    else
    {
        rssUrl_sports = rssUrl;
        newsCount_sports=num;       
    }
    

   	$("sports_content").children[0].style.display="block";
    $("sports_content").children[0].innerHTML = "<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    var option={
        parameters:"t=news&rssUrl="+rssUrl_sports+"&num="+newsCount_sports,
        method:"get",
		onSuccess:function(transport){
		    var rp = transport.responseText;
			var doc=new X2Doc(rp);
			var result=doc.root.getValue("newsCount");
            if(result>0)
            {
                var news_sports = "<ul class='News'>";
                for(var i=1;i<=result;i++)
                {                
                    var NewsCss;
                    if(i%2==0)
                    {
                        NewsCss = "News2";
                    }
                    else
                    {
                        NewsCss = "News1";
                    }
                    if(if_pubDate_sports==0 || !if_pubDate_sports)
                    {
                         news_sports += "<li class='" +NewsCss+ "'><img src='Images/article.gif' />&nbsp; <a target='_blank' href='" +doc.root.contents[i].getValue("link")+ "'>" +doc.root.contents[i].getValue("title")+ "</a></li>";
                    }
                    else
                    {
                          news_sports += "<li class='" +NewsCss+ "'><img src='Images/article.gif' />&nbsp; <a target='_blank' href='" +doc.root.contents[i].getValue("link")+ "'><b>" +doc.root.contents[i].getValue("title")+ "</b></a><br />" +doc.root.contents[i].getValue("pubDate")+ "</li>";                       
                    }
                }
                news_sports+="</ul>";
                $("sports_content").children[0].innerHTML = news_sports;
            }
		    else 
		    {
		        $("sports_content").children[0].innerHTML = "对不起,还没有您要查看的新闻!";
		    }
        },
        onFailure:function(){
			 $("sports_content").children[0].innerHTML = "数据获取失败,请检查网络或重试。";	    
        }
    }
    
    var request=new Ajax.Request("ajax.aspx",option);
}

//
function EditNews_Sports()
{
    var div_sports = $("sports_content").children[0];
    if($("sports_content").children[0].style.display=="none" && sports_news)
    {
        sports_news.hide();
        $("sports_content").children[0].style.display="block";
    }
    else
    {
        sports_news=new FormBox("sports_news_edit");

	    sports_news.insertItem("select","rssWeb",{foreLabel:'类别:',liClassName:'aaa',selectArray:['国际足坛,http://rss.sina.com.cn/sports/global/focus.xml']});
	    sports_news.addSelectValue("rssWeb","国内足坛","http://rss.sina.com.cn/sports/china/focus.xml");
	    sports_news.addSelectValue("rssWeb","NBA新闻","http://rss.sina.com.cn/sports/basketball/nba.xml");
	    sports_news.addSelectValue("rssWeb","焦点新闻","http://rss.sina.com.cn/news/allnews/sports.xml");
    	
	    sports_news.insertItem("select","newsCount",{foreLabel:'条数:',selectArray:['6,6']});
	    sports_news.addSelectValue("newsCount","5","5");
	    sports_news.addSelectValue("newsCount","7","7");
	    sports_news.addSelectValue("newsCount","8","8");
	    sports_news.addSelectValue("newsCount","9","9");
	    sports_news.addSelectValue("newsCount","10","10");

    	sports_news.insertItem("","top",{foreLabel:'显示:',liClassName:'checkbox'});
	    sports_news.insertItem("checkbox","title",{sameLine:true,backLabel:'题目'});
	    sports_news.insertItem("checkbox","pubDate",{sameLine:true,backLabel:'时间'});

	    sports_news.insertItem("button","btnSave",{liClassName:'button',value:'保存'});
        sports_news.items["btnSave"].onclick=EditNews_Sports2;

	    $("sports_content").children[0].style.display="none";
	    $("sports_content").appendChild(sports_news.getBox());
	}
	

}

function EditNews_Sports2()
{
    rssUrl_sports = sports_news.getValue("rssWeb");
    newsCount_sports = sports_news.getValue("newsCount");
    if_pubDate_sports = sports_news.getValue("pubDate");
    setcookie("sports_content",rssUrl_sports+"|"+newsCount_sports+"|"+if_pubDate_sports);
    sports_news.hide();
    GetNews_Sports(rssUrl_sports,newsCount_sports);
}




//
function EditNews_ElseNews()
{
    var div_ElseNews = $("ElseNews_content").children[0];
    if($("ElseNews_content").children[0].style.display=="none" && ElseNews_news)
    {
        ElseNews_news.hide();
        $("ElseNews_content").children[0].style.display="block";
    }
    else
    {
        ElseNews_news=new FormBox("ElseNews_news_edit");

	    ElseNews_news.insertItem("select","rssWeb",{foreLabel:'类别:',liClassName:'aaa',selectArray:['网易旅游,http://travel.163.com/special/00061K7R/rss_travel4.xml']});
	    ElseNews_news.addSelectValue("rssWeb","瑞丽性爱","http://www.rayli.com.cn/news/0017.xml");
	    ElseNews_news.addSelectValue("rssWeb","音乐试听","http://mp3.music.sohu.com/new.xml");
	    ElseNews_news.addSelectValue("rssWeb","新浪文化","http://rss.sina.com.cn/edu/focus19.xml");
	    ElseNews_news.addSelectValue("rssWeb","新浪军事","http://rss.sina.com.cn/jczs/focus.xml");
	    ElseNews_news.addSelectValue("rssWeb","民生资讯","http://www.yegaa.com/App/RssReader.aspx?id=65c81a8b-7f12-4c9e-a46a-d871005a091c");
	    ElseNews_news.addSelectValue("rssWeb","数码·生活","http://digi.it.sohu.com/rss/shuma.xml");
	    ElseNews_news.addSelectValue("rssWeb","新浪军事","http://rss.sina.com.cn/jczs/focus.xml");
    	
	    ElseNews_news.insertItem("select","newsCount",{foreLabel:'条数:',selectArray:['5,5']});
	    ElseNews_news.addSelectValue("newsCount","6","6");
	    ElseNews_news.addSelectValue("newsCount","7","7");
	    ElseNews_news.addSelectValue("newsCount","8","8");
	    ElseNews_news.addSelectValue("newsCount","9","9");
	    ElseNews_news.addSelectValue("newsCount","10","10");


	    ElseNews_news.insertItem("button","btnSave",{liClassName:'button',value:'保存'});
        ElseNews_news.items["btnSave"].onclick=EditNews_ElseNews2;

	    $("ElseNews_content").children[0].style.display="none";
	    $("ElseNews_content").appendChild(ElseNews_news.getBox());
	}
	

}

function EditNews_ElseNews2()
{
    rssUrl_ElseNews = ElseNews_news.getValue("rssWeb");
    newsCount_ElseNews = ElseNews_news.getValue("newsCount");
    setcookie("ElseNews_content",rssUrl_ElseNews+"|"+newsCount_ElseNews);
    ElseNews_news.hide();
    GetNews_ElseNews(rssUrl_ElseNews,newsCount_ElseNews);
}

function GetPics()
{
    var picStr="<img class='thePic' src='Images/demo/01.jpg' />";
    picStr+="<img class='thePic' src='Images/demo/03.jpg' />";
    picStr+="<img class='thePic' src='Images/demo/02.jpg' /><br />";
    picStr+="<img class='thePic' src='Images/demo/03.jpg' />";
    picStr+="<img class='thePic' src='Images/demo/04.jpg' />";
    picStr+="<img class='thePic' src='Images/demo/01.jpg' />";
    $("photo_content").children[0].innerHTML = picStr;


}

//获得视频文件
//获得视频文件
function GetVideo()
{
      $("Video_content").children[0].style.display="block";
      $("Video_content").children[0].innerHTML = "<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
      var video_str = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='240' height='180'><param name='movie' value='http://www.ruochi.com/product/vcastr2/vcastr21.swf'><param name='quality' value='high'><param name='allowFullScreen' value='true' /><param name='FlashVars' value='vcastr_file=http://jn.mesou.net/Online_UpFile/flv/20070307/20070307042345.flv' /> <embed src='http://www.ruochi.com/product/vcastr2/vcastr21.swf' allowFullScreen='true' FlashVars='vcastr_file=http://jn.mesou.net/Online_UpFile/flv/20070307/20070307042345.flv' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='240' height='180'></embed></object>";
      $("Video_content").children[0].innerHTML = video_str;
}


    //获得房产信息
function GetHouseInfo()
{
    document.getElementById("tixing_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Get_Houseinfo("sale",CallBack_HouseInfo);
}
//数据回传
function CallBack_HouseInfo(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("tixing_outer").children[0].children[1].innerHTML = res.value;
    }
    else
    {
       document.getElementById("tixing_outer").children[0].children[1].innerHTML = "读取数据出错!";
    }
}
//采集网易新闻
function Get163NewsInfo()
{

    document.getElementById("java_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Read_CatchFile("45",CallBack_Get163NewsInfo);
}
//数据回传
function CallBack_Get163NewsInfo(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("java_content").children[0].innerHTML = res.value;
    }
    else
    {
       document.getElementById("java_content").children[0].innerHTML = "读取数据出错!";
    }
}

//采集猫扑新闻
function GetMopNewsInfo()
{
    document.getElementById("search_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Read_CatchFile("46",CallBack_GetMopNewsInfo);
}
//数据回传
function CallBack_GetMopNewsInfo(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("search_content").children[0].innerHTML = res.value;
    }
    else
    {
       document.getElementById("search_content").children[0].innerHTML = "读取数据出错!";
    }
}
//ElseNews_title_2
//采集猫扑新闻
function GetMopNewsInfo()
{
    document.getElementById("search_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Read_CatchFile("46",CallBack_GetMopNewsInfo);
}
//数据回传
function CallBack_GetMopNewsInfo(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("search_content").children[0].innerHTML = res.value;
    }
    else
    {
       document.getElementById("search_content").children[0].innerHTML = "读取数据出错!";
    }
}

//采集天涯新闻
function GetTianyaNewsInfo()
{
    document.getElementById("ElseNews_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Read_CatchFile("49",CallBack_GetTianyaNewsInfo);
}
//数据回传
function CallBack_GetTianyaNewsInfo(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("ElseNews_content").children[0].innerHTML = res.value;
    }
    else
    {
       document.getElementById("ElseNews_content").children[0].innerHTML = "读取数据出错!";
    }
}
//发送房产信息文件
function Read_House(H_Para)
{
    document.F2.action="ReadHouse.aspx?InfoID="+H_Para;
    document.F2.submit();
}
//发送新闻信息
function Read_News(N_Para)
{
    document.F2.action="ReadNewInfo.aspx?NewsID="+N_Para;
    document.F2.submit();
}
//采集鬼故事
function GetGhost()
{
    document.getElementById("food_content").children[0].innerHTML="<center><br /><br /><br /><img src='Images/inprogress.gif' /></center>";
    _Default.Read_CatchFile("50",CallBack_GetGhost);
}
//鬼故事数据回传
function CallBack_GetGhost(res)
{
    if(!res.error && res.value !="")
    {
       document.getElementById("food_content").children[0].innerHTML = res.value;
    }
    else
    {
       document.getElementById("food_content").children[0].innerHTML = "读取数据出错!";
    }
}
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途) 企业QQ:4000410510
地址:北京市海淀区中关村鼎好大厦A座二层 邮编:100080
Room A-801,Dinghao Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2015. 京ICP备09089570号 | 京公网安备11010702000869号
在线客服
分享该页面
关闭侧边栏