这对我有用
theURL='http://mysite.com/Project1/Forms/AllItems.aspx?RootFolder=%2FProject1%2FLesson%2014&FolderCTID=0x01200075C0E8AC5A64724787732A3200049D3A&View={440F5454-054D-4C68-A1E2-4A52E4FD8FCB}';
filePath = theURL.match(/RootFolder\=(.*?)&/)[1].replace(/%2F/g, "/")+"/presentation.swf";
alert(filePath);
我认为您甚至不需要解码 url 即可在 src 中使用它,因此您可以使用
filePath = theURL.match(/RootFolder\=(.*?)&/)[1]+"%2Fpresentation.swf";
尝试 SWFObject https://code.google.com/p/swfobject/wiki/documentation
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>SWFObject dynamic embed - step 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(filePath, "myContent", "300", "120", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
或者如果您使用的是 jQuery,您可以尝试http://jquery.lukelutman.com/plugins/flash/
$(document).ready(function(){
$('#example').flash(
{ src: filePath,
width: 720,
height: 480 },
{ version: 8 }
);
});
<div id="example">You don't have flash</div>
或http://jquery.thewikies.com/swfobject/
$(document).ready(
function() {
$('#myFlash').flash(filePath);
}
);
<div id="myFlash">You don't have flash</div>
我在上述示例中的正确位置包含了 filePath 变量