我有一个php项目,我通过我自己的计算机内的wampserver运行它,效果很好。但问题是,当我想从本网络中的本地计算机访问它时,网站加载不完整,当我通过firebug跟踪它时出现此错误:
Reference error $ is not defined
错误对应于js文件。
这是我调用js文件的php文件:
<?php
class ControllerModuleBanner extends Controller {
public function index($setting) {
static $module = 0;
$this->load->model('design/banner');
$this->load->model('tool/image');
$this->document->addScript('catalog/view/javascript/jquery/flexslider/jquery.flexslider-min.js');
$data['banners'] = array();
$results = $this->model_design_banner->getBanner($setting['banner_id']);
foreach ($results as $result) {
if (is_file(DIR_IMAGE . $result['image'])) {
$data['banners'][] = array(
'title' => $result['title'],
'link' => $result['link'],
'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
);
}
}
$data['module'] = $module++;
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/banner.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/banner.tpl', $data);
} else {
return $this->load->view('default/template/module/banner.tpl', $data);
}
}
}
答案 0 :(得分:0)
或者: