中国网管论坛's Archiver

wsyamaha 发表于 2006-5-22 12:40

帮帮我,急啊》》对JS.JS实现动态维护

弹出动态维护:
要求:
        对JS.JS实现动态维护:

实现方法:


采用文本文件:js.php
开头放
<?
if (!defined('CONSTANT')) {
    exit;
}
?>
#0-6
[url]http://www.sina.com.cn[/url]
[url]http://www.shgao.com[/url]
#6-11
………..
修改:




程序调用
<?
Define(“CONSTANT”,”1”);
用file读出进数组.
当读到#0-6时,把下面两个链接付值给$urlarr[$x]
以此类推
调用模板替换对应变量
生成静态
?>

以下的是js.js文件内容{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{


function index()
{
        var now   =  new  Date();   
        var user  ="http://www.91cy.cn";
        var user2 ="http://www.91cy.cn";
        var yy    =  now.getHours();
        if (yy>=14 && yy<16)//14-17
        {
                user        ="http://www.shgao.com/cyitem/shimeien/index.php" ;
                user2        ="http://cy.91cy.cn/cyitem/tms/";
        }
        else if(yy>=16 && yy<17)
        {
                user        ="http://cy.91cy.cn/cyitem/ysw/index.php" ;
                user2        ="http://91.shgao.com/j.php?id=1228";
        }

        else if (yy>=11 && yy<14)//11-14
        {
                user        ="http://www.shgao.com/cyitem/qingqingcao/index.php" ;
                user2        ="http://91.shgao.com/j.php?id=1221";

        }
        else if (yy>=6 && yy<11)//6-11
        {
                user        ="http://51.91cy.cn/cyitem/xinghairi/index.php";
                user2        ="http://www.backjoin.com/ainbei/guanggao/sina/?comefrom=sayb&id=20";       
        }else if (yy<6 ){//0-6
                user="http://91.shgao.com/j.php?id=1222";
                user2="http://net.91cy.cn/webjump.php?www=91cy&id=18";
        }else if (yy>=17 && yy<20){//17-20
                user="http://cy.91cy.cn/cyitem/mmyp/index.php";
                user2="http://91.shgao.com/j.php?id=1223";
        }else{
                user        ="http://net.91cy.cn/webjump.php?www=91cy&id=11";
                user2        ="http://net.91cy.cn/webjump.php?www=91cy&id=12";
        }
         //window.open('http://www.6cc.cn');
         window.open(user, 'index', 'width=497,height=620,top=0, left=0, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, status=yes');
         window.open(user2, 'index1', 'width=497,height=620,top=0, left=520, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, status=yes');
        //window.open("http://cy.91cy.cn/cy_open_jlgy.html","cytdjlgy","toolbar=no, status=no,menubar=no, scrollbars=no,resizable=no,width=200,height=300,left=780,top=10");
}

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com