加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

图片轮播器bcastr4.swf“&”符号的问题

发布时间:2020-12-15 06:26:13 所属栏目:百科 来源:网络整理
导读:bcastr4.swf是一个很不错的网页图片轮播器,我一直使用它作为网站首页图片轮播的控件。 http://xiaogui.org/bcastr-open-source-flash-image-silde-show.html 上对这个控件的使用方法都有详细的描述。 但是我们在使用过程中发现,使用object直接写入参数的方

bcastr4.swf是一个很不错的网页图片轮播器,我一直使用它作为网站首页图片轮播的控件。

http://xiaogui.org/bcastr-open-source-flash-image-silde-show.html 上对这个控件的使用方法都有详细的描述。

但是我们在使用过程中发现,使用object直接写入参数的方法时,如果在<link>节点中的URL存在“&”符号的时候,控件就会一片空白。

其实任何节点上只要再出现“&”符号,均会发生这个情况,因为从html代码的角度看,此写法是乱套了的

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>test</title>
</head>
<body>
	<div style="margin:20px 0;"><a href="http://www.ruochigroup.com/main/2008/03/19/bcastr-40/">http://www.ruochigroup.com/main/2008/03/19/bcastr-40/</a></div>
	<div>
		<object type="application/x-shockwave-flash" data="bcastr4.swf" width='300' height='300' id='vcastr3'>
		<param name='movie' value="bcastr4.swf?xml=
			<data>
				<channel>
					<item>
						<link>http://www.ezdrink.com.cn</link>
						<image>http://apensu-pc:8001/1/01.jpg</image>
						<title>aaaaaaa&bbbbbbb</title>
					</item><item>
						<link></link>
						<image>http://apensu-pc:8001/1/02.jpg</image>
						<title></title>
					</item><item>
						<link></link>
						<image>http://apensu-pc:8001/1/03.jpg</image>
						<title></title>
					</item><item>
						<link></link>
						<image>http://apensu-pc:8001/1/04.jpg</image>
						<title></title>
					</item><item>
						<link></link>
						<image>http://apensu-pc:8001/1/05.jpg</image>
						<title></title>
					</item>
				</channel>
			</data>" />
	</object>

</div>
</body>
</html>

其实bcastr4.swf已经内置了这个符号的处理方法,我们需要做的就是将“&”替换成“^”即可。

更改之后,你可以看到"^"是被转换成"&"的。

如果你使用的是xml文件的方式,那么不会发现这个问题,直接使用“&”符号即可。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读