douyan6742 2015-08-18 02:13
浏览 54

在视图文件夹codeigniter中加载文件xml

I make data.php in view folder like this

<script type="text/javascript" src="swfobject.js"></script>
    <div id="flashPlayer">
      This text will be replaced by the flash music player.
    </div>
<script type="text/javascript">
   var so = new SWFObject("playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF"); 
   so.addVariable("autoPlay","yes")
   so.addVariable("repeat","false")
   so.addVariable("playlistPath","playlist.xml")
   so.write("flashPlayer");
</script>`

and my trouble is, I put file swfobject.js, playerMultipleList.swf, playlist.xml on view folder too and when I run, system can't read all of that file.

have any solution ???

  • 写回答

1条回答 默认 最新

  • dongnong3799 2015-08-18 02:22
    关注

    When you link file source like you did in your view it doesn't look for the files in view folder but root of your system. so you can create a folder at the root of your system(where application, system folders are, or basicaly where index.php is) and put your files there. then you can ink like in the below code. I assumed the folder name is "inc".

    <script type="text/javascript" src="inc/swfobject.js"></script>
     <div id="flashPlayer">
      This text will be replaced by the flash music player.
     </div>
    <script type="text/javascript">
       var so = new SWFObject("inc/playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF"); 
       so.addVariable("autoPlay","yes")
       so.addVariable("repeat","false")
       so.addVariable("playlistPath","playlist.xml")
       so.write("flashPlayer");
    </script>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号