layer.open is not a function怎么解决
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了layer.open is not a function怎么解决相关的知识,希望对你有一定的参考价值。
网上查资料和不断尝试,终于找到原因了.1)网上一种解释:
If you are trying to add your own jQuery code to WordPress, and have had the error “$ is not a function” show up on Firebug, here is the fix:
Convert all dollar signs ($) to ‘jquery’
The dollar sign is reserved in WordPress for the Prototype library, which is why it errors out. For example, instead of:
1
2
3
$().ready(function()
$("#select_me").show();
);
Change it to:
1
2
3
jQuery().ready(function()
jQuery("#select_me").show();
);
2)按照上面该法没作用. Error msg 变成: jQuery(***).dialog is not a function.
一个下午的努力, 觉得可能是js冲突所致. 一行行删代码, 发现是下面一行. 原来不是方法冲突, 而是引用冲突吧?!
"<script src="<session:constant name='ContextPath'/>/js/jquery-1.8.5/js/jquery-1.4.2.min.js" type="text/javascript"></script>". 在内部Frame的jsp中, 这样一行删除就OK了. 可能是外部已经引用了, 删除后jQuery的方法都正常了. 参考技术A <script src="../Js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../Js/Dialog/layer.js" type="text/javascript"></script>
function showClientDialog()
$.layer(
type: 2,
title: ["选择产品", true],
fix: true,
move: false,
maxmin: true,
shadeClose: false,
shade: [0.3, '#000', true],
border: [5, 0.3, '#666', true],
offset: [($(window).height() - 480) / 2 + 'px', ''],
area: [1000 + 'px', 480 + 'px'],
iframe: src: "../WarehouseManager/CheProduct.aspx"
);
本回答被提问者采纳
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to funct
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题:
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
in <module>
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see ‘Working with Matplotlib in Virtual environments‘ in the Matplotlib FAQ
似乎是因为虚拟环境与默认环境的安装配置不同造成的。
搜索错误信息之后,在STO上找到了解决方案:
1、pip安装matplotlib之后,会在根目录下产生一个.matplotlib的目录:
? bin ll ~/.matplotlib
我是通过cd ~/.matplotlib 进入这个文件夹的 cd ~命令是进入home目录 (就是进入home目录下的一个.matplotlib文件夹下)
total 280
-rw-r--r-- 1 me staff 78K 10 4 2015 fontList.cache
-rw-r--r-- 1 me staff 59K 1 17 15:56 fontList.py3k.cache
drwxr-xr-x 2 me staff 68B 10 4 2015 tex.cache
2、在这个目录下创建一个名为matplotlibrc的文件,内容是:
backend: TkAgg
然后保存退出,重启Python交互界面或重新运行脚本,import正常执行。
以上是关于layer.open is not a function怎么解决的主要内容,如果未能解决你的问题,请参考以下文章
React报错:Error: Element type is invalid: expected a string (for built-in components) or a class/funct