以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  svg图片老是提示:“单击以激活并使用此控件”,怎么解决啊[原创]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=48004)


--  作者:shaopingahut
--  发布时间:6/5/2007 9:14:00 AM

--  svg图片老是提示:“单击以激活并使用此控件”,怎么解决啊[原创]
svg图片老是提示:“单击以激活并使用此控件”,怎么解决啊
--  作者:gambey
--  发布时间:6/6/2007 10:09:00 AM

--  
和windows更新有关,需要删掉一个更新补丁才行!
--  作者:yi_xiao
--  发布时间:6/6/2007 3:18:00 PM

--  
在控制面板的"添加删除程序"中删除编号为"KB912945"的更新,如果列表中没有显示,需要在"添加删除程序"窗口右上角的“显示更新”前打√。

  如果这个也找不到,那你就一个一个更新程序看,看哪一个包涵(Internet Explorer ActiveX 更新程序(更新 912945))。查看方法是点击安全更新程序,再点击下面的“单击此处获得支持信息”,再在弹出的对话框中单击“支持信息”的Microsoft链接就可以了。


--  作者:shaopingahut
--  发布时间:6/7/2007 10:54:00 AM

--  
谢谢了兄弟,可以代码控制吗,这样让客户看起来不大可能啊
--  作者:yi_xiao
--  发布时间:6/18/2007 4:37:00 PM

--  
以下是引用shaopingahut在2007-6-7 10:54:00的发言:
谢谢了兄弟,可以代码控制吗,这样让客户看起来不大可能啊

可以用代码控制,方法如下,注意这条不仅适合svg,还适合flash.

一、将“svg.js”文件放入站点任意文件夹中

二、在网页<head></head>之间插入以下代码

<!--修正FLASH正确显示代码开始-->
<script language="javascript" type="text/javascript" src="flash.js的相对路径"></script>
<!--修正FLASH正确显示代码结束-->

三、用下面java语句完全替换网页中“<object> ……〈/object>"(包括首尾标记)

以下内容为程序代码:
<script language="javascript" type="text/javascript">
writeflashhtml("_swf=你的FLASH文件地址", "_width=你的FLASH文件宽度", "_height=你的FLASH文件高度" ,"_wmode=transparent");
</script>

svg.js 源码
[code]
//代码开始
function writeflashhtml( arg )
{
var parm = []
var _default_version = "8,0,24,0";
var _default_quality = "high";
var _default_align = "middle";
var _default_menu = "false";

for(i = 0; i < arguments.length; i ++)
{
parm[i] = arguments[i].split(' ').join('').split('=')
for (var j = parm[i].length-1; j > 1; j --){
parm[i][j-1]+="="+parm[i].pop();
}
switch (parm[i][0])
{
case '_version' : var _version = parm[i][1] ; break ;
case '_swf' : var _swf = parm[i][1] ; break ;
case '_base' : var _base = parm[i][1] ; break ;
case '_quality' : var _quality = parm[i][1] ; break ;
case '_loop' : var _loop = parm[i][1] ; break ;
case '_bgcolor' : var _bgcolor = parm[i][1] ; break ;
case '_wmode' : var _wmode = parm[i][1] ; break ;
case '_play' : var _play = parm[i][1] ; break ;
case '_menu' : var _menu = parm[i][1] ; break ;
case '_scale' : var _scale = parm[i][1] ; break ;
case '_salign' : var _salign = parm[i][1] ; break ;
case '_height' : var _height = parm[i][1] ; break ;
case '_width' : var _width = parm[i][1] ; break ;
case '_hspace' : var _hspace = parm[i][1] ; break ;
case '_vspace' : var _vspace = parm[i][1] ; break ;
case '_align' : var _align = parm[i][1] ; break ;
case '_class' : var _class = parm[i][1] ; break ;
case '_id' : var _id = parm[i][1] ; break ;
case '_name' : var _name = parm[i][1] ; break ;
case '_style' : var _style = parm[i][1] ; break ;
case '_declare' : var _declare = parm[i][1] ; break ;
case '_flashvars' : var _flashvars = parm[i][1] ; break ;
default :;
}
}
var thtml = ""
thtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + ((_version)?_version:_default_version) + "'"
if(_width) thtml += " width='" + _width + "'"
if(_height) thtml += " height='" + _height + "'"
if(_hspace) thtml += " hspace='" + _hspace + "'"
if(_vspace) thtml += " vspace='" + _vspace + "'"
if(_align) thtml += " align='" + _align + "'"
else thtml += " align='" + _default_align + "'"
if(_class) thtml += " class='" + _class + "'"
if(_id) thtml += " id='" + _id + "'"
if(_name) thtml += " name='" + _name + "'"
if(_style) thtml += " style='" + _style + "'"
if(_declare) thtml += " " + _declare
thtml += ">"
if(_swf) thtml += "<param name='movie' value='" + _swf + "'>"
if(_quality) thtml += "<param name='quality' value='" + _quality + "'>"
else thtml += "<param name='quality' value ='" + _default_quality + "'>"
if(_loop) thtml += "<param name='loop' value='" + _loop + "'>"
if(_bgcolor) thtml += "<param name='bgcolor' value='" + _bgcolor + "'>"
if(_play) thtml += "<param name='play' value='" + _play + "'>"
if(_menu) thtml += "<param name='menu' value='" + _menu + "'>"
else thtml += "<param name='menu' value='" + _default_menu + "'>"
if(_scale) thtml += "<param name='scale' value='" + _scale + "'>"
if(_salign) thtml += "<param name='salign' value='" + _salign + "'>"
if(_wmode) thtml += "<param name='wmode' value='" + _wmode + "'>"
if(_base) thtml += "<param name='base' value='" + _base + "'>"
if(_flashvars) thtml += "<param name='flashvars' value='" + _flashvars + "'>"
thtml += "<embed pluginspage='http://www.macromedia.com/go/getflashplayer'"
if(_width) thtml += " width='" + _width + "'"
if(_height) thtml += " height='" + _height + "'"
if(_hspace) thtml += " hspace='" + _hspace + "'"
if(_vspace) thtml += " vspace='" + _vspace + "'"
if(_align) thtml += " align='" + _align + "'"
else thtml += " align='" + _default_align + "'"
if(_class) thtml += " class='" + _class + "'"
if(_id) thtml += " id='" + _id + "'"
if(_name) thtml += " name='" + _name + "'"
if(_style) thtml += " style='" + _style + "'"
thtml += " type='application/x-shockwave-flash'"
if(_declare) thtml += " " + _declare
if(_swf) thtml += " src='" + _swf + "'"
if(_quality) thtml += " quality='" + _quality + "'"
else thtml += " quality='" + _default_quality + "'"
if(_loop) thtml += " loop='" + _loop + "'"
if(_bgcolor) thtml += " bgcolor='" + _bgcolor + "'"
if(_play) thtml += " play='" + _play + "'"
if(_menu) thtml += " menu='" + _menu + "'"
else thtml += " menu='" + _default_menu + "'"
if(_scale) thtml += " scale='" + _scale + "'"
if(_salign) thtml += " salign='" + _salign + "'"
if(_wmode) thtml += " wmode='" + _wmode + "'"
if(_base) thtml += " base='" + _base + "'"
if(_flashvars) thtml += " flashvars='" + _flashvars + "'"
thtml += "></embed>"
thtml += "</object>"
document.write(thtml)
}

//代码结束
[/code]

这里有一篇相应的文章,分为客户端及网站开发人员的两种方案
http://www.eramx.com/forum/showthread.php?t=834


--  作者:shaopingahut
--  发布时间:6/18/2007 5:30:00 PM

--  
谢谢以上所有的好兄弟!!!!
--  作者:liuyjs
--  发布时间:6/20/2007 4:54:00 PM

--  adobe 的网站上有统一的解决方法 flash  svg 都行!
<html>
 <head>
  <script src="AC_ActiveX.js" type="text/javascript"></script>
  <script src="AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<embed src="tt.svg" height="400" width="400" type="image/svg+xml"
pluginspage="http://www.adobe.com/svg/viewer/install/"
style="border: 1px solid black; padding:5px;"/>
<div id="D1">
     <script type="text/javascript">
   AC_AX_RunContent( 'height','400','width','400','src','tt.svg','type','image/svg+xml', 'pluginspage','http://www.adobe.com/svg/viewer/install/');
</script>
  </div>
  <div id="D2">
     <script type="text/javascript">
   AC_AX_RunContent( 'height','400','width','400','src','tt.svg','type','image/svg+xml', 'pluginspage','http://www.adobe.com/svg/viewer/install/');
</script>
  </div>
</body>
</html>

这是我作的测试,已经没有问题了。
两个js 附在后面!也可以到adobe的网站上找

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?');
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs)
{
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){ 
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie": 
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "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":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//v1.1
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AX_RunContent(){
  var ret = AC_AX_GetArgs(arguments);
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_AX_GetArgs(args){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){ 
      case "pluginspage":
      case "type":
      case "src":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "data":
      case "codebase":
      case "classid":
      case "id":
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "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":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  return ret;
}



--  作者:shaopingahut
--  发布时间:6/25/2007 2:57:00 PM

--  
谢谢了,好兄弟,我马上就测试
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
390.625ms