Codeigniter 和 SWFObject

发布于 2024-08-16 17:38:10 字数 1597 浏览 3 评论 0原文

我正在使用 Flex、Codeigniter 构建一个网站,并使用 swfobject 来嵌入 swf。 如果我使用 Codeigniter 的 index.php 文件访问网站,这将不起作用。

这是输出源:

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://localhost/Pixelatte-debug/"/>
<link rel="stylesheet" type="text/css" href="history/history.css" />
<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>
<script src="history/history.js" language="javascript"></script>

<style>
body { margin: 0px; overflow:hidden; background:url('swirlsbg.png') }
</style>

</head>

<body scroll="no">
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

 var flashVars = {};

 var params = { play: "true",
       loop: "false",
       quality: "high",
       wmode: "transparent",
       allowscriptaccess: "sameDomain" };

 var attributes = { id: "${application}" };

 swfobject.embedSWF( "${swf}.swf",
      "divContent",
      "100%", "100%",
      "9.0.0",
      "expressInstall.swf",
      flashVars,
      params,
      attributes );
</script>

<div id="divContent">
 <h1>Alternative content</h1>
 <p><a href="http://www.adobe.com/go/getflashplayer">
 <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />

 </a></p>
</div>
</body>
</html>

我的猜测是 codeigniter 未检测到 swfobject.js 。

I'm building a website using Flex, Codeigniter, and I use swfobject to embed the swf.
This will not work if I access the website using Codeigniter's index.php file.

This is the ouput source:

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://localhost/Pixelatte-debug/"/>
<link rel="stylesheet" type="text/css" href="history/history.css" />
<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>
<script src="history/history.js" language="javascript"></script>

<style>
body { margin: 0px; overflow:hidden; background:url('swirlsbg.png') }
</style>

</head>

<body scroll="no">
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

 var flashVars = {};

 var params = { play: "true",
       loop: "false",
       quality: "high",
       wmode: "transparent",
       allowscriptaccess: "sameDomain" };

 var attributes = { id: "${application}" };

 swfobject.embedSWF( "${swf}.swf",
      "divContent",
      "100%", "100%",
      "9.0.0",
      "expressInstall.swf",
      flashVars,
      params,
      attributes );
</script>

<div id="divContent">
 <h1>Alternative content</h1>
 <p><a href="http://www.adobe.com/go/getflashplayer">
 <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />

 </a></p>
</div>
</body>
</html>

My guess is that swfobject.js is not detected by codeigniter..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自我难过 2024-08-23 17:38:10

结果如何? (替换文本,还是损坏的对象标签......?)
swfobject.js 是否正确加载?
您的 SWF 文件的路径是否正确?
最终的 HTML 输出是什么?
也许其中一个细节就能解决您的问题。

What is the result? (The replacement text, or a broken object tag...?)
Is swfobject.js loaded properly?
Is your SWF file's path correct?
What is your final HTML output?
Maybe one of the details will solve your problem.

绝情姑娘 2024-08-23 17:38:10

CodeIgniter 不会成为你的问题。您应该使用 Firebug(火狐插件)之类的工具来确认您的资产确实被发现。

Codeignitor 不会知道你的 JS,但你的浏览器会。如果 JS 没有运行,则可能是 JS 代码有错误,或者是您的浏览器没有找到它。

CodeIgniter won't be your issue here. You should use a tool like Firebug (a firefox plugin) to confirm your assets are actually being found.

Codeignitor won't know about your JS, your browser will. If the JS isn't running there is either a fault in the JS code, or it isn't found by your browser.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文