How to use the Adobe SVG Auto-Installer in your Web pages
To make use of the auto-installer script demonstrated in this page, you need to download the script files "svgcheck.js" and "svgcheck.vbs" here:
download autoinstall.zip
Place these files on your site and add the following lines to the <head> element of your HTML document (with the URL appropriate for your site's structure):
<script language="JavaScript" src="svgcheck.js"></script> <script language="VBScript" src="svgcheck.vbs"></script>
You then need to add the following code before the first SVG graphic. This should be called once per page. It will put up an alert to ask about installation, so it's best to put it after any HTML you want visible when the alert appears:
<script language="JavaScript"><!-- checkAndGetSVGViewer(); // --> </script>
Finally, you need to add this code once for each SVG graphic (modified as appropriate, of course, for the URL and size of your graphic):
<script language="JavaScript"><!--
emitSVG('src="hello.svg" name="SVGEmbed" height="200" width="600" type="image/svg-xml"');
// -->
</script>
<noscript>
<embed src="hello.svg" name="SVGEmbed" height="200" width="600" type="image/svg-xml"
pluginspage="http://www.adobe.com/svg/viewer/install/">
</noscript>
本文介绍如何在网页中使用Adobe SVG Auto-Installer脚本。首先需下载并放置svgcheck.js和svgcheck.vbs文件到网站目录,并在HTML文档头部引入这些文件。然后调用checkAndGetSVGViewer()函数进行安装提示,并为每个SVG图形添加相应的脚本及备选内容。

3007

被折叠的 条评论
为什么被折叠?



