我是Prototype的新手,但我总是使用jQuery.我有一个网站,我需要使用jQuery和Prototype.我遇到以下代码问题:
var x = [];
console.log(x);
for (var l in x)
{
console.log(l);
}
Run Code Online (Sandbox Code Playgroud)
运行此代码,x包含以下内容:
each
eachSlice
all
any
collect
detect
findAll
select
grep
include
member
inGroupsOf
inject
invoke
max
min
partition
pluck
reject
sortBy
toArray
entries
zip
size
inspect
find
_reverse
_each
clear
first
last
compact
flatten
without
uniq
intersect
clone
预期结果(无原型):
There are no child objects
Prototype为什么会这样做,以及如何阻止它?
谢谢
相当新的Magento安装,产品设置等,即将导出产品CSV,一旦我提交了正常的表格,错误"没有有效的数据发送"我开始做一些调试,看看是什么发生了.第一站是例外.log
Notice: Undefined index: in /app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php on line 539' in /app/code/core/Mage/Core/functions.php:245
Run Code Online (Sandbox Code Playgroud)
导致问题的功能是:
/**
* Update data row with information about categories. Return true, if data row was updated
*
* @param array $dataRow
* @param array $rowCategories
* @param int $productId
* @return bool
*/
protected function _updateDataWithCategoryColumns(&$dataRow, &$rowCategories, $productId)
{
if (!isset($rowCategories[$productId])) {
return false;
}
$categoryId = array_shift($rowCategories[$productId]);
$dataRow[self::COL_ROOT_CATEGORY] = $this->_rootCategories[$categoryId];
if (isset($this->_categories[$categoryId])) {
$dataRow[self::COL_CATEGORY] = $this->_categories[$categoryId];
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
对于某些原因,$ categoryId没有设置为$ rowCategories不是数组.
我刚刚重新运行了索引管理,但在我看来,类似于类别或类似的东西.我知道快速解决方法是在继续之前检查$ categoryId是否已设置,但我想首先知道导致错误的原因.