| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 734 人关注过本帖
标题:请看的懂的人帮忙看下,谢了!
只看楼主 加入收藏
小丁丁
Rank: 2
等 级:论坛游民
帖 子:50
专家分:50
注 册:2008-5-6
收藏
 问题点数:0 回复次数:0 
请看的懂的人帮忙看下,谢了!
我是刚学的,遇到这个不知道什么意思,请大家帮看下,大概是什么意思 ?谢谢!!!

    function mGET(arrayKey, arrayValue, Value) {
        count = arrayKey.length;
        for(i=0;i<count;i++) {
            if(arrayKey[i]==Value) {
                return arrayValue[i];
                break;
            }
        }
    }

    function mEmbed() {
        var key = new Array();
        var value = new Array();
        var contents;
        var embed_type;
        var error_check=0;
        var i, j;
        var count;
        var data;
        var temp;
        if(mEmbed.arguments.length==1) {
            contents = mEmbed.arguments[0];
        } else {
            for(i=0;i<mEmbed.arguments.length;i++) {
                temp = mEmbed.arguments[i].replace(/"|'/g,"");
                data = temp.split('=');
                key[i] = data[0];
                value[i] = data[1];
                count = data.length;

                for(j=2;j<count;j++) {
                    value[i] += '=' + data[j];
                }
            }

            contents='';
            srcdata = mGET(key,value,'src');

            if(/\.(swf)$/.test(srcdata)) {
                embed_type = 1;
            } else if(/\.(mov|avi|wma|wmv)$/.test(srcdata)) {
                embed_type = 2;
            }

            var classid = mGET(key,value,'classid');
            var codebase = mGET(key,value,'codebase');

            if(embed_type==1) {
                classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
                codebase = 'http://download.,0,29,0';
            } else if(embed_type==2) {
                classid = 'clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95';
                codebase = 'http://activex.,4,5,715';
            }

            if(classid && codebase) {
                contents += '<object';
                if(classid) {
                    contents += ' classid="' + classid + '"';
                }
                if(codebase) {
                    contents += ' codebase="' + codebase + '"';
                }
                count = key.length;
                for(i=0;i<count;i++) {
                    if(value[i]!='') {
                        if(key[i]!='src') {
                            contents += ' ' + key[i] + '="' + value[i] + '"';
                        }
                    }
                }
                contents += '>';
                for(i=0;i<count;i++) {
                    if(value[i]!='') {
                        if(embed_type==1 && key[i]=='src') {
                            contents += '<param name="movie" value="' + value[i] + '" />';
                        } else {
                            contents += '<param name="' + key[i] + '" value="' + value[i] + '" />';
                        }
                    }
                }
            }
            count = key.length;
            contents += '<embed';
            for(i=0;i<count;i++) {
                if(value[i]!='') {
                    contents += ' ' + key[i] + '="' + value[i] + '"';
                }
            }
            contents += '>';
            contents += '</embed>';
            if(classid && codebase) {
                contents += '</object>';
            }
        }
        document.write(contents);
    }
搜索更多相关主题的帖子: arrayKey count length Value 
2008-05-30 15:03
快速回复:请看的懂的人帮忙看下,谢了!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.034210 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved