>  기사  >  웹 프론트엔드  >  Sina_javascript 스킬에서 플래시를 표시하는 데 사용되는 기능

Sina_javascript 스킬에서 플래시를 표시하는 데 사용되는 기능

WBOY
WBOY원래의
2016-05-16 19:15:561126검색

시나에서 플래시를 표시하는 기능은
sinaflash.js

코드 복사코드는 다음과 같습니다.

/**
  * @author [sina]zhangping1@
  * @version v1.1.3
  * 날짜:2006-9-8 2006-12-15
  */
if(typeof(sina)!="object"){var sina={}}
sina.$=function(objId){if( !objId){throw new Error("sina.$(String objId)参数必须")}
if(document.getElementById){return eval('document.getElementById("' objId '")')}else if (document.layers){return eval("document.layers['" objId "']")}else{return eval('document.all.' objId)}}
sinaFlash=function(C,v,x ,V,c,X,i,O,I,l,o){var z=this;if(!document.createElement||!document.getElementById){return}
z.id=v?v: "";z.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";z.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version= " (c?c:"7") ",0,0,0";z.width=x;z.height=V;z.movie=C;z.bgcolor=X?X:null;z.quality =O?O:"높음";z.src=z.movie;z.pluginspage="http://www.macromedia.com/go/getflashplayer";z.type="application/x-shockwave-flash" ;z.useExpressInstall=i?i:null;z.xir=(I)?I:window.location;z.redirectUrl=l?l:null;z.DetectKey=o?o:null;z.escapeIs=false ;z.objAttrs={};z.params={};z.flashVars=[];z.flashVarsStr="";z.embedAttrs={};z.forSetAttribute("id",z.id);z .objAttrs["classid"]=z.classid;z.forSetAttribute("codebase",z.codebase);z.forSetAttribute("width",z.width);z.forSetAttribute("height",z.height) ;z.forSetAttribute("movie",z.movie);z.forSetAttribute("quality",z.quality);z.forSetAttribute("pluginspage",z.pluginspage);z.forSetAttribute("type",z. type);z.forSetAttribute("bgcolor",z.bgcolor)}
sinaFlash.prototype={getFlashHtml:function(){var I=this,i='i ='>';for(var l in I.params){i =' '}
if(I.flashVarsStr!=""){i =' '}
i ='i =' >< /embed>';return i},forSetAttribute:function(I,i){var l=this;I=I.toLowerCase();switch(I){case "classid":break;case " pluginspage":l.embedAttrs["pluginspage"]=i;break;case "src":l.embedAttrs["src"]=i;l.params["movie"]=i;break;case "movie": l.params["movie"]=i;l.embedAttrs["src"]=i;break;case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblClick":케이스 "ondrag":케이스 "ondragend":케이스 "ondragenter":케이스 "ondragleave":케이스 "ondragover":케이스 "ondrop":케이스 "onfinish":케이스 "onfocus":케이스 "onhelp":케이스 "onmousedown":사례 "onmouseup":사례 "onmouseover":사례 "onmousemove":사례 "onmouseout":사례 "onkeypress":사례 "onkeydown":사례 "onkeyup":사례 "onload":사례 "onlosecapture":사례 "onpropertychange":사례 "onreadystatechange":사례 "onrowsdelete":사례 "onrowenter":사례 "onrowexit":사례 "onrowsinserted":사례 "onstart":사례 "onscroll":사례 "onbeforeeditfocus":사례 "onactivate":사례 "onbeforedeactivate":case "ondeactivate":case "type":l.embedAttrs["type"]=i;break;case "codebase":l.objAttrs["codebase"]=i;break;case "width": l.objAttrs["width"]=i;l.embedAttrs["width"]=i;break;case "height":l.objAttrs["height"]=i;l.embedAttrs["height"]=i ;break;case "align":l.objAttrs["align"]=i;l.embedAttrs["align"]=i;break;case "vspace":l.objAttrs["vspace"]=i;l. embedAttrs["vspace"]=i;break;case "hspace":l.objAttrs["hspace"]=i;l.embedAttrs["hspace"]=i;break;case "class":l.objAttrs[" class"]=i;l.embedAttrs["class"]=i;break;case "title":l.objAttrs["title"]=i;break;case "accesskey":l.objAttrs["accesskey"] =i;break;case "name":l.objAttrs["name"]=i;l.embedAttrs["name"]=i;break;case "id":l.objAttrs["id"]=i; l.embedAttrs["name"]=i;break;case "tabindex":l.objAttrs["tabindex"]=i;break;default:l.params[I]=l.embedAttrs[I]=i}} ,forGetAttribute:function(i){var I=this;i=i.toLowerCase();if(I.objAttrs[i]!=undefine){return I.objAttrs[i]}else if(I.embedAttrs[i ]!=정의되지 않음){return I.embedAttrs[i]}else if(I.embedAttrs!=정의되지 않음){return I.embedAttrs[i]}else{return null}},setAttribute:function(I,i){this .forSetAttribute(I,i)},getAttribute:function(i){return this.forGetAttribute(i)},addVariable:function(I,i){var l=this;if(l.escapeIs){I=escape( I);i=escape(i)}
if(l.flashVarsStr==""){l.flashVarsStr=I "=" i}else{l.flashVarsStr ="&" I "=" i}
l.embedAttrs["FlashVars"]=l.flashVarsStr},getVariable:function(I){var o=this,i=o.flashVarsStr;if(o.escapeIs){I=escape(I)}
var l=new RegExp(I "=([^\&]*)(\&?)","i").exec(i);if(o.escapeIs){return unescape(RegExp.$1 )}
RegExp.$1 반환},addParam:function(I,i){this.forSetAttribute(I,i)},getParam:function(){return this.forGetAttribute(name)},write:function(i ){var I=this;if(typeof i=="string"){sina.$(i).innerHTML=I.getFlashHtml()}else if(typeof i=="object"){i.innerHTML=I .getFlashHtml()}}}    /**
* @author [sina]zhangping1@
* @version v1.1.3
* 날짜:2006-9-8 2006-12-15
*/ 
if(typeof(sina)!="object"){
var sina={


sina .$=function(objId){
if(!objId){
throw new Error("sina.$(String objId)参数必须")

if(document.getElementById){
return eval('document.getElementById("' objId '")')
} else if(document.layers){
return eval("document.layers['" objId "']")
} else{
return eval('document.all.' objId)


sinaFlash=function(C,v,x,V,c,X,i,O ,I,l,o){
var z=this;
if(!document.createElement||!document.getElementById){
return

z.id=v?v:"";
z.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
z.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" (c?c:"7") ",0,0,0" ;
z.width=x;
z.height=V;
z.movie=C;
z.bgcolor=X?X:null;
z.quality=O?O:"높음";
z.src=z.movie;
z.pluginspage="http://www.macromedia.com/go/getflashplayer";
z.type="application/x-shockwave-flash";
z.useExpressInstall=i?i:null;
z.xir=(I)?I:window.location;
z.redirectUrl=l?l:null;
z.DetectKey=o?o:null;
z.escapeIs=false;
z.objAttrs={
} ;
z.params={
} ;
z.flashVars=[];
z.flashVarsStr="";
z.embedAttrs={
} ;
z.forSetAttribute("id",z.id);
z.objAttrs["classid"]=z.classid;
z.forSetAttribute("codebase",z.codebase);
z.forSetAttribute("너비",z.width);
z.forSetAttribute("높이",z.height);
z.forSetAttribute("movie",z.movie);
z.forSetAttribute("quality",z.quality);
z.forSetAttribute("pluginspage",z.pluginspage);
z.forSetAttribute("type",z.type);
z.forSetAttribute("bgcolor",z.bgcolor)

sinaFlash.prototype={
getFlashHtml:function(){
var I=this,i='for(var l in I.objAttrs){
i =l '="' I.objAttrs[l] '" '

i ='>';
for(var l in I.params){
i =' '

if(I.flashVarsStr!=""){
i =' '

i ='<삽입';
for(var l in I.embedAttrs){
i =l '="' I.embedAttrs[l] '" '

i =' >< ;/개체>';
반품 i
} ,forSetAttribute:function(I,i){
var l=this;
I=I.toLowerCase();
switch(I){
case "classid":break;
case "pluginspage":l.embedAttrs["pluginspage"]=i;
휴식;
케이스 "src":l.embedAttrs["src"]=i;
l.params["movie"]=i;
휴식;
case "movie":l.params["movie"]=i;
l.embedAttrs["src"]=i;
휴식;
사례 "onafterupdate":사례 "onbeforeupdate":사례 "onblur":사례 "oncellchange":사례 "onclick":사례 "ondblClick":사례 "ondrag":사례 "ondragend":사례 "ondragenter":사례 " ondragleave":케이스 "ondragover":케이스 "ondrop":케이스 "onfinish":케이스 "onfocus":케이스 "onhelp":케이스 "onmousedown":케이스 "onmouseup":케이스 "onmouseover":케이스 "onmousemove":케이스 " onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case " onrowexit":case "onrowsinserted":case "onstart":case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":l.embedAttrs["type" ]=나;
휴식;
case "codebase":l.objAttrs["codebase"]=i;
휴식;
case "width":l.objAttrs["width"]=i;
l.embedAttrs["width"]=i;
휴식;
case "height":l.objAttrs["height"]=i;
l.embedAttrs["height"]=i;
휴식;
case "align":l.objAttrs["align"]=i;
l.embedAttrs["align"]=i;
휴식;
case "vspace":l.objAttrs["vspace"]=i;
l.embedAttrs["vspace"]=i;
휴식;
case "hspace":l.objAttrs["hspace"]=i;
l.embedAttrs["hspace"]=i;
휴식;
case "class":l.objAttrs["class"]=i;
l.embedAttrs["class"]=i;
휴식;
case "title":l.objAttrs["title"]=i;
휴식;
case "accesskey":l.objAttrs["accesskey"]=i;
휴식;
case "name":l.objAttrs["name"]=i;
l.embedAttrs["name"]=i;
휴식;
case "id":l.objAttrs["id"]=i;
l.embedAttrs["name"]=i;
휴식;
case "tabindex":l.objAttrs["tabindex"]=i;
휴식;
default:l.params[I]=l.embedAttrs[I]=i

} ,forGetAttribute:function(i){
var I=this;
i=i.toLowerCase();
if(I.objAttrs[i]!=undefine){
return I.objAttrs[i]
} else if(I.embedAttrs[i]!=undefine){
return I. embedAttrs[i]
} else if(I.embedAttrs!=undefine){
return I.embedAttrs[i]
} else{
return null

} ,setAttribute :function(I,i){
this.forSetAttribute(I,i)
} ,getAttribute:function(i){
return this.forGetAttribute(i)
} ,addVariable:function( I,i){
var l=this;
if(l.escapeIs){
I=escape(I);
i=escape(i)

if(l.flashVarsStr==""){
l.flashVarsStr=I "=" i
} else{
l. flashVarsStr ="&" I "=" i

l.embedAttrs["FlashVars"]=l.flashVarsStr
} ,getVariable:function(I){
var o=this,i =o.flashVarsStr;
if(o.escapeIs){
I=escape(I)

var l=new RegExp(I "=([^\&]*)(\&?)", "i").exec(i);
if(o.escapeIs){
return unescape(RegExp.$1)

return RegExp.$1
} ,addParam:function(I,i){
이것. forSetAttribute(I,i)
} ,getParam:function(){
return this.forGetAttribute(name)
} ,write:function(i){
var I=this;
if(typeof i=="string"){
sina.$(i).innerHTML=I.getFlashHtml()
} else if(typeof i=="object"){
i.innerHTML=I.getFlashHtml()




사용 방법:
复代码 代码如下:


< ; div id="flashcontent_01639EBFB760">플래시는 지원되지 않습니다

🎜>







< div id="flashcontent_97C36D34A728">플래시는 지원되지 않습니다

< !--ADS:end-->