如何将100个链接放在一页上 [英] how to put 100 links one page

查看:62
本文介绍了如何将100个链接放在一页上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生如何在一页中放置100个网站链接
链接每隔5秒间隔出现一次.

sir how to put 100 websites links in one page
links come one by one 5 sec gap

推荐答案

您可以使用ajax.
示例Javascript:
You can use ajax for it.
Example Javascript:
var _count = 0;
var _max = 200;

var secs;
var timerID = null;
var timerRunning = false;
var delay = 5000;

var J = jQuery.noConflict();

function InitializeTimer() {
secs = 10000;
StopTheClock();
StartTheTimer();
}

function StopTheClock() {
if (timerRunning)
clearTimeout(timerID);
timerRunning = false;
}

function StartTheTimer() {

    var id = _count; 
    J.ajax({
        url: "GetNextLink.ashx",
        type: "GET",
        dataType: ''html'',
        data: { ''Next'': id },
        success: function (data) {
                J(''#divLinks'').html(J(''#divLinks'').html()+data);
        }
    });

_count++;

if (secs == 0) {
StopTheClock();
}
else {
if (_max == _count) {
StopTheClock();
}
else {
self.status = secs;
secs = secs – 1;
timerRunning = true;
timerID = self.setTimeout("StartTheTimer()", delay);
}
}
}



C#代码



C# code

Page.ClientScript.RegisterStartupScript(this.GetType(), "javaScript", "InitializeTimer();", true);


您需要将这些链接存储在数据库/XML文件中.并使用计时器控件在首页的标签"控件中显示这些链接.

我为您提供逻辑. :)
you need to store these links in database/XML file. and use timer control to display these links in Label control on your home page.

I provide you the logic. :)


这篇关于如何将100个链接放在一页上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆