问题标签 [document-root]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1368 浏览

php - PHP - Document_Root 与子域

我的配置文件中有以下代码来建立根路径,然后在整个应用程序中使用它:

问题是它似乎不适用于子域。如果我尝试将我的配置文件包含到子域上的 PHP 文件中,自然会出现错误。

我怎样才能解决这个问题?如何建立允许子域的根路径?我以前从未这样做过,所以我不知道如何去做。

谢谢!

0 投票
2 回答
639 浏览

jquery - 如何在jQuery中选择子元素而不是根元素(同名)

在我的 XML 中,我有一些与根元素同名的子元素。我正在寻找一种方法来选择那些子元素,而不是根元素。我一直在浏览 jQuery 选择器文档,并搜索了一堆,但我唯一能找到的是面临相反问题的人:选择孩子和根,这是完美的工作(太好了:))为了我!

这是一些示例 XML:

现在,当我执行以下操作时,我将获得 2 个对象:someMoreVariationElement 的根元素和 2 个子元素:

我想知道,也许我可以使用

但这仅适用于 myElement 实际上是根元素的情况,但这并不能保证。它可以是别的东西。就像 someElementWithVariableName 和 someMoreVariationElement 一样,它们都可以是任何东西。所以基本上......我需要一个选择器,如果它是某个东西的孩子,它只会得到 myElement 。

(如果它只选择级别 3 的所有 myElement 实例会更好(将 root 计为级别 0, someElementWithVariableName 计为级别 1, someMoreVariationElement 计为级别 2))

0 投票
2 回答
1815 浏览

actionscript-3 - AS3: Really weird "inaccessable" error when referencing document root object

Alright, I am pulling my hair out on this one. Got this problem at around 9 last night and was up until 5 trying to fix it, and then all day so far (it's already about 9 PM again) trying to fix it. I've tried everything I can think of.

Alright, so I'm trying to reference the document object from various classes in my class library. Everything seemed to be going peachy until I started getting this random, weird error. I thought maybe it was Flash acting up all of a sudden but I tried it on my Mac as well and I get the same error.

Basically no matter WHAT I do, I am getting the error:

1195: Attempted access of inaccessible method getSessionHandler through a reference with static type pim:PClient

It's a lot of code, but here is the full code.

and...

Alright so right now, I have sort of a singleton reference that I'm using so I can reference the document object from any class (without the need to pass the client object to each class that needs to use it). I'm pretty sure I've done this before and had it work, but obviously it is not.

I've even tried passing the client object (this) to the PCommandLoader object and it STILL gives this really really strange error (that is WITHOUT the use of any static methods, etc.)

WHAT THE HECK IS GOING ON? I've tried EVERYTHING -- even a class that holds the PClient object reference, which was really messy -- and it still gives this really, really weird message. Even referencing the root property on movieclips gives me this error. The movie was working great and then magically it started doing this. I backed everything up and undid everything back to pretty much empty script files and it wouldn't let me compile since...

I'm going crazy here! Help?

EDIT Alright, with strict mode set to off, it compiles and works 100% as expected. What gives?

EDIT Here is the describeType on PClient.getInstance() right before the error:

0 投票
1 回答
1165 浏览

apache - htaccess document_root 目录名

是否有可能做到这一点

我需要获取 DOCUMENT_ROOT 的父文件夹

0 投票
1 回答
575 浏览

php - Zend 框架 URL 索引

我安装了 Zend 框架 1.11.5 我有 Wamp 2.2 并运行 windows7。

我在 apache documentRoot('c:/wamp/www');'mysite' 文件夹结构中有一个文件夹(mysite):

问题:如果我将浏览器指向“http://localhost/mysite/public/”,我可以正确看到我的索引页。但是如果我指向“http://localhost/mysite/public/index/”或“http” ://localhost/ejoin2ED/public/index/index' 我看到了 Wampserver 配置页面(我认为这是我拥有的另一个页面的输出,'c:/wamp/www' 内的 'index.php' )。

我不应该看到 index.phtml 的内容吗?

谢谢

卢卡

.htaccess

索引.php

引导程序.php

0 投票
4 回答
650 浏览

php - PHP中的单引号反转行为

我正在运行一个示例脚本并解决了这个特定问题。

脚本通过设置开始

对于写入文件,

用来。但无论如何,这都无法写入文件。

经过一段时间的修补后,我将命令设置为

使用单引号而不是双引号,效果很好!

我的问题是,以前的双引号格式不是应该工作而不是单引号。这里发生了什么?

这是精简的代码,伙计们(假设该文件存在于服务器中):

0 投票
3 回答
2757 浏览

node.js - 是否可以将文件系统根和/或文档根设置为文件系统的某个子目录?

我想知道是否可以为 node.js 中的静态资源请求(如果有任何此类区别)指定文件系统根目录或文档根目录的子目录。

我知道我可以通过连接根的绝对路径来做到这一点,但我想知道它是否可以在应用程序范围内完成。

我在文档中没有发现任何支持它的东西,但也许我忽略了它。


编辑: 我应该提一下,此时我对使用 3rd 方库不感兴趣。

0 投票
7 回答
139885 浏览

server - WAMP 中的 Web 服务器根目录在哪里?

Web 服务器根目录也是您放置站点文件并稍后在浏览器中使用 localhost/file_name 访问它们的地方吗?

0 投票
5 回答
888 浏览

php - PHP:如何不对 Web 应用程序根目录进行硬编码

我目前在我的应用程序的配置文件中有以下内容:

第一行完美运行。我可以在任何地方包含配置文件,然后DOCROOT按预期使用常量。

第二行也可以,但它是硬编码的,这意味着当我将此文件上传到我的网络服务器时,它会出错。它应该在那里http://samples.example.com。有什么好的方法可以防止这种硬编码吗?我有点认为我必须在某个地方硬编码一些东西,在那种情况下,我能逃脱什么,能逃脱多少?

0 投票
3 回答
11808 浏览

jquery - 用 jQuery 引用根 html 元素的最佳方法?

<html>在 jQuery中获取根文档节点(元素)的最佳方式(性能方面)是什么?我可以想到几种可能有效也可能无效的方法:

$("html")

$(document.documentElement)

$(document)(?)

$.root(?)

$.document(?)