【问题标题】:Paths not working to handsontable JS and CSS路径不适用于可操作的 JS 和 CSS
【发布时间】:2015-02-27 15:00:29
【问题描述】:

这可能真的很容易,但我很难过,无法让路径在我的 codeigniter 项目中工作。我正在尝试安装最新的掌上电脑 (.12.2) 。按照说明 (https://github.com/handsontable/handsontable/tree/master/dist),我的页面顶部有以下 html:

<html> 
  <head> 
      <base href="<?=base_url();?>">


      <!-- jQuery -->
<script type="text/javascript" charset="utf8" src="http://code.jquery.com/jquery-1.9.0.js"></script>      

<script src="handsontable/dist/handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="handsontable/dist/handsontable.full.css">

文件结构在屏幕截图中。

当我尝试加载页面时,我在控制台中看到以下内容:

"NetworkError: 404 Not Found - http://localhost/b1/handsontable/dist/handsontable.full.css"
"NetworkError: 404 Not Found - http://localhost/b1/handsontable/dist/handsontable.full.js"
"NetworkError: 404 Not Found - http://localhost/b1/handsontable/dist/handsontable.full.css"

我做错了什么?

【问题讨论】:

    标签: javascript html css codeigniter handsontable


    【解决方案1】:

    我猜在&lt;base href="&lt;?=base_url();?&gt;"&gt; 你应该做&lt;base href="&lt;?php echo base_url();?&gt;"&gt;。应该可以的。

    【讨论】:

    • 好的。你的 .htaccess 配置是什么?您的网站是否有 example.com/index.php/controller 类型的网址?如果是,那么您的 url 文件 url 正在寻找类似 @​​987654321@ 的内容,如果您还没有检查,也可以检查这个。 @user61629
    • 我这里没有 htaccess 文件。我已经通过使用 github repo 作为 CDN handsontable.com/dist/handsontable.full.css"> ,
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-11
    • 2020-05-21
    • 1970-01-01
    • 2013-02-07
    • 2011-02-21
    • 2019-09-30
    相关资源
    最近更新 更多