wampserver src输出不正确

时间:2014-08-23 12:59:12

标签: wampserver src

我在Windows 7上使用wampserver并设置了wordpress。我试图使用几种方法包含一个js文件,但服务器正在添加额外的位置..

e.g。使用wp_enqueue_scripts输出:

wp_enqueue_script('qtip', AD_PATH.'/js/qtip/jquery.qtip.min.js', array('jquery'), false, true);
当回音:C:\wamp\www\market/wp-content/plugins/market

时,

AD_PATH在屏幕上正确输出

但在Chrome控制台中,会出现http://localhost/marketC:wampwwwmarket/wp-content/plugins/market/js/qtip/jquery.qtip.min.js?ver=3.9.2

使用

<script type="text/javascript" src='localhost/market/wp-content/plugins/market/js/qtip/jquery.qtip.min.css'></script>

输出

http://localhost/market/merchant/register/localhost/market/wp-content/plugins/market/js/qtip/jquery.qtip.min.css

这会将当前页面位置添加到src。

我的wampserver索引文件有问题,不包括localhost,并将$ suppress_localhost更改为false并$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://localhost/' : '').$file.'">'.$file.'</a></li>';

任何想法?

1 个答案:

答案 0 :(得分:0)

要解决您的问题,请修改wamp/www/index.php文件。第30行有:

$suppress_localhost = true;

将其更改为:

$suppress_localhost = false;