在不知道其命名空间的情况下卸载JavaScript库(Unload JavaScript Libraries without knowing their namespace)
我想知道是否有可能卸载JavaScript库(例如
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
)而不知道它命名空间。 我删除了元素,但jQuery仍然可用。 显然我可以把$和jQuery擦掉,但这不是我想要实现的。这个问题不是关于jQuery,它可能是任意的JavaScript导入。
编辑:
为了解决我的问题,是否有可能解决函数原点,就像浏览器在其检查器中所做的那样? 类似函数是在导入X中的第360行定义的吗?
谢谢! 亚历山德罗
I'd like to know whether theres a possibility to unload JavaScript libraries (e.g.
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
) without knowing its namespace. I removed the element but jQuery is still available. Obviously I could just wipe $ and jQuery away but thats not what I'd like to achieve.This question is not about jQuery, it could be any arbitrary JavaScript Import.
Edit:
To reverse my question is it possible to resolve a functions origin, like the browsers do in their Inspectors? Like function is defined at Line 360 in Import X?
Thank you! Alessandro
原文:https://stackoverflow.com/questions/20285770
最满意答案
默认情况下,Zend Framework期望URL中的参数采用
/key/value
的形式。 尝试这个:http://mydomain.com/controller/action/key1/value1
print_r($request->getParams());
结果是:
Array ( [controller] => controller [action] => action [key1] => value1 )
编辑:正如其他人提到的,如果你想坚持使用
http://mydomain.com/controller/action/value1
你应该看看Zend_Controller_Router
。For default, Zend Framework expects the parameters in URL to be in the form of
/key/value
. Try this:http://mydomain.com/controller/action/key1/value1
print_r($request->getParams());
The result is:
Array ( [controller] => controller [action] => action [key1] => value1 )
Edit: as others mentioned, If you want to stick with
http://mydomain.com/controller/action/value1
you should take a look atZend_Controller_Router
.
相关问答
更多-
我如何从代码中看到,你有Admin_Controller和一些动作edit (默认路由)。 要获得编辑值,U需要生成像domain.com/admin/edit/id/12/这样的网址(例如)。 而且在动作edit使用下一个: $id = $this->_request->getParam('id',0); if ($id){ //get info for edit by ID } 编辑 如果您仍然需要domain.com/admin/edit/12网址,请执行下一步: $uri = $this- ...
-
嗨,这是真的很常见。 创建一个视图脚本,如:/views/emails/template.phtml name; ?>
Welcome
mysite; ?> 当创建电子邮件时: // create view object $html = new Zend_View(); $html->setScriptPath(APPLICATION_PATH . '/modules/default/v ... -
这个问题有点不清楚。 您是在尝试配置由其他人编写的模块,还是在询问如何使您自己的模块提供用户友好的配置? 通过了解配置如何工作来解决这两个问题。 在设计良好的模块中,您通常会有一个config目录,它将包含两个文件: config/module.config.php和
.global.php.dist 。 module.config.php用于内部(私有)配置。 使用您的模块的人可能不关心内容。 .global.php.dist包含用户可能想要更改的所有配置数据 ... -
当然,一个解决方案(使用Apache)将在我的视图中调用它: $this->url(array(page=>2)) . ($_SERVER['QUERY_STRING']?$_SERVER['QUERY_STRING']:"") 但是你不能确定这将永远包含在$ _SERVER变量中。 Of course one solution (with Apache) would be to call this in my view: $this->url(array(page=>2)) . ($_SERVER['Q ...
-
您可以使用像这样的一些包管理器来提取单独的ZF文件,这将告诉您需要哪些文件并为您压缩它们。 Zend_Dom_Query只需要 Zend公司/大教堂/ Query.php Zend公司/大教堂/查询/ Css2Xpath.php Zend公司/大教堂/查询/ Result.php Zend公司/大教堂/ Exception.php Zend公司/ Exception.php 无论如何,它可以下载 。 如果迫切需要 - 还有很多其他工具,比如ZF。 You can pull out the separate ...
-
您需要在url中编写param名称,然后按以下方式获取param值: $param1 = $this->getRequest()->getParam('param1'); $param2 = $this->getRequest()->getParam('param2'); 网址应如下所示: http://example.com/mycontroller/myaction/param1/value1/param2/value2 如果你想从url下面得到param值: http://example.com ...
-
默认情况下,Zend Framework期望URL中的参数采用/key/value的形式。 尝试这个: http://mydomain.com/controller/action/key1/value1 print_r($request->getParams()); 结果是: Array ( [controller] => controller [action] => action [key1] => value1 ) 编辑:正如其他人提到的,如果你想坚持使用http://myd ...
-
zend framework zend_db:它提供了什么来转义sql参数(zend framework zend_db: what does it provide to escape sql parameters)[2022-03-07]
请参阅引用值和标识符 。 您还可以在创建查询时使用Zend_Db_Select ,它将自动调用quoteInto。 See Quoting Values and Identifiers. You can also use Zend_Db_Select when creating your query, which will automatically call quoteInto. -
您是否为Zend_Locale设置了全局缓存? 检查此文档页面并滚动到底部。 另外,检查您的APC设置。 我自己不使用APC,但是当缓存大小太小时,XCache会出现性能问题。 这也可能是您的配置问题。 要配置Zend_Locale和Zend_Local_Format使用的缓存,请使用Zend_Locale::setCache($cache)和Zend_Locale_Format::setOptions(array('cache' => $adapter)) 。 可以在手册中找到。 Have you set ...
-
您可以将用户名传递给视图,并将其添加到URL-ViewHelper中的url参数: $this->url(array('module' => 'client', 'controller' => 'feedback', 'action' => 'new', 'username' => $username), null, true) You can pass the username to the view and add it to the url's parameters in the URL-ViewH ...