为什么相对src变得绝对,Apache,HTML5?

时间:2017-06-14 14:27:04

标签: apache src

为什么相对src变得绝对,Apache,HTML5?

项目结构:

host/public/somedomain.com
host/public/somedomain.com/public
host/public/somedomain.com/public/index.php
//notvisible from outside
host/private/somedomainPrivate/core/App.php
host/private/somedomainPrivate/js 
host/private/somedomainPrivate/js/loadprivate.js

在host / public / somedomain.com / public / index.php

//i create App.php
use core/App
$app = new App(); 
//$app contains some logics, to load other files and generate views.

在host / private / somedomainPrivate / core / App.php

// i would like to refer to loadprivate.js using
define( 'INC_ROOT', dirname(__DIR__) ); 
echo "<br><br> in App.php INC_ROOT =". INC_ROOT ; // host/private/somedomainPrivate
define('URL_VIEWFNC_JS', INC_ROOT . '/js' ); 
echo '<script src="'. URL_VIEWFNC_JS .'/loadprivate.js" type="text/javascript" ></script>';

我收到GET错误,无法加载该文件: https://somedomain.com/js/loadprivate.js

我的意思是指向host/private/somedomainPrivate/js/loadprivate.js的相对网址已转换为绝对https://somedomain.com/js/loadprivate.js

是否可以从私人文件夹加载loadprivate.js

0 个答案:

没有答案