我在IE 9中遇到了JavaScript范围的真正问题.
这是在我的文档正文中(是的,我知道脚本应该在正确的HTML中,但我从来没有打破过脚本).该脚本在正文中,因为我不想弄乱只与此页面相关的脚本的共享页眉:
<script type="text/javascript">
function googleMapsQuery(accountNum) {
// function code is here (omitted for brevity)
}
</script>
Run Code Online (Sandbox Code Playgroud)
这是在td块内部tr块内的tbody块内部table块内部form块内部body:
<button id="google-422111" onclick="googleMapsQuery(422111)" type="button">Google This!</button>
Run Code Online (Sandbox Code Playgroud)
我甚至将脚本块移到了表单上方,以防脚本函数声明的顺序相关(事实并非如此).
该脚本在FireFox和Chrome中运行完美,但在IE 9中(有或没有兼容性视图),我收到此错误:
SCRIPT5007:属性"googleMapsQuery"的值为null或未定义,而不是Function对象
我研究了JavaScript范围,我无法弄清楚为什么IE认为'googleMapsQuery'是一个属性,以及为什么它未定义.这是一个功能,我定义了它!
javascript runtime-error function undefined internet-explorer-9
我已经安装了VS 2012并在一些Web项目上成功使用它,但是它的一些东西导致我的Web服务项目中断.我仍然在Web服务项目上使用VS 2010,并且还没有在2012年打开它.
一切都编译并正常工作,除非它试图在我引用的weblog项目中创建一个类的实例,然后它抛出此错误:
在调用HttpRequest.GetBufferlessInputStream之后,不支持此方法或属性.
我在项目中找不到显式使用GetBufferlessInputStream的任何地方.
如果我跳过博客代码,一切都正确执行.
我找不到其他任何收到此错误的人试图缩小它,任何想法从哪里开始?
堆
at System.Web.HttpRequest.get_InputStream()
at OAS.Web.Log.WebEvent..ctor(EventType type, HttpContext context, String applicationName)
at OAS.Web.Log.WebTrace..ctor(HttpContext context, String applicationName)
at OAS.Web.AdvisorServices.Extensions.OperationLoggerParameterInspector.BeforeCall(String operationName, Object[] inputs) in C:\SourceControl\OAS\IM.NET3.0\Web\AdvisorServices\OAS.Web.AdvisorServices.Extensions\OperationLogger\OperationLoggerParameterInspector.cs:line 54
Run Code Online (Sandbox Code Playgroud)
**编辑 - 奖金问题
为什么这些Framework 4.5属性会影响我的4.0解决方案?
在Android上使用OSGi平台时我得到了这个errormsg:

致命信号7(SIGBUS)位于0x595302e0(代码= 2)
我认为我的应用程序在内存中需要那么多空间或者需要很多计算能力.它只是OSGi平台,有20个捆绑包.
我的应用程序总是在那之后重新启动.
有任何想法吗 ?
我刚刚将我的应用程序从Facebook iOS SDK 3.1升级到3.2.1,我正在尝试利用NSError上新FBError类别提供的新错误处理.代码位于底部.它编译得很好,但是当发生FB错误时,我在运行时得到以下内容:
- [NSError fberrorShouldNotifyUser]: unrecognized selector sent to instance
Run Code Online (Sandbox Code Playgroud)
这似乎是一个链接器错误,其中类别未从FacebookSDK静态库链接.我尝试在目标中的其他链接器标志下添加-ObjC和-all_load标志.我读到这个:http://developer.apple.com/library/mac/#qa/qa1490/但仍然没有运气.
基本上相同的代码在Facebook提供的示例项目中工作正常.谢谢你的任何建议.
// Open the Facebook session.
- (void)openSession {
NSArray *permissions = [[NSArray alloc] initWithObjects:@"email", nil];
// Open or re-open the active session
[FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
}
- (void)handleAuthError:(NSError *)error{
NSString *alertMessage, *alertTitle;
if (error.fberrorShouldNotifyUser) {
// If the SDK has a message for the user, surface it. This conveniently
// …Run Code Online (Sandbox Code Playgroud) 以下代码段:
for weight, item in itemlist do
weight_total=weight_total+weight
end
Run Code Online (Sandbox Code Playgroud)
在该代码段的第一行导致错误"尝试调用表值".为什么?
Itemlist是权重和字符串表的表,如下所示:
local itemlist = {
{4,"weapon_pistol"},
{2,"weapon_357"},
...
Run Code Online (Sandbox Code Playgroud)
据我所知,没有任何东西被称呼; 为什么会出现这个错误?
好的,所以我在调试时遇到了很多问题.我正在使用VS2013 Pro和Windows 8.1.两者都是最新的.问题是,当我开始调试时,它会抛出此错误的一半时间:
System.Windows.Forms.dll中发生了未处理的"System.AccessViolationException"类型异常
附加信息:尝试读取或写入受保护的内存.这通常表明其他内存已损坏.
它也不是我的代码的错.我做了一个简单的测试作为例子如下.请注意,我没有从此应用程序引用System.Windows.Forms.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
List<int> testing = new List<int>();
for(int i =0; i < 50; i++)
{
testing.Add(i);
}
for (int i = 0; i < 50; i++)
{
Console.WriteLine(testing[i].ToString());
}
Console.ReadLine();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道是什么造成了这个.如果我单击"确定"并再次运行它,它将起作用.偶尔我必须做两次.
有任何想法吗?
堆栈跟踪:

有一个类似的问题,但它没有得到解决:
W/CameraBase:连接到摄像机时出错:在camera.open()调用时出现0
我有一个(自然)使用相机的应用程序.它一直很好.但是,在构建之间没有代码更改的情况下,应用程序开始崩溃(通过Git提交历史记录验证没有代码更改).
为了进一步验证问题是在硬件的某个地方,我在另一部手机上运行相同的代码,它工作得很好.不知何故,相机被锁定,无法打开.
这是相关代码:
创建一个previe对象
_cameraPreview = new CameraPreview(getActivity(),_camera);
Run Code Online (Sandbox Code Playgroud)
这是它的创建代码
public CameraPreview(Context context, Camera camera)
{
super(context);
_camera = camera;
_surfaceHolder = getHolder();
_surfaceHolder.addCallback(this);
}
Run Code Online (Sandbox Code Playgroud)
打开相机:
//默认打开后置摄像头
public static Camera getCameraInstance()
{
Camera c = null;
try
{
c = Camera.open();
}catch (Exception e)
{
e.printStackTrace();
}
return c;
}
Run Code Online (Sandbox Code Playgroud)
这是发生错误的地方,camera.Open使用以下堆栈跟踪抛出错误.我的相机对象为空.这段代码来自官方的Android文档,但如果它从会话外锁定,他们不会谈论如何"释放相机".
完全注销是
W/CameraBase? An error occurred while connecting to camera: 0
W/System.err? java.lang.RuntimeException: Fail to connect to camera service
W/System.err? at android.hardware.Camera.<init>(Camera.java:497)
W/System.err? at android.hardware.Camera.open(Camera.java:357)
W/System.err? at co.pumpup.app.EditPhotoFragment.getCameraInstance(EditPhotoFragment.java:241)
W/System.err? …Run Code Online (Sandbox Code Playgroud) 玩Java(特别是v9)我发现了这种情况:
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
interface A {
static A staticMethod() {
try {
Method method = A.class.getDeclaredMethods()[0];
return (A) method.invoke(null);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
public class Test {
public static void main(String[] args) {
A.staticMethod();
}
}
Run Code Online (Sandbox Code Playgroud)
该程序流应该导致StackOverflow错误,但是,我得到了一个NoClassDefFoundError.
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 880
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 880 …Run Code Online (Sandbox Code Playgroud) 这是我要运行的代码:
ax = plt.axes(axisbg='#E6E6E6')
ax.set_axisbelow(True)
plt.grid(color='w',linestyle='solid')
for spine in ax.spines.values():
spine.set_visible(False)
ax.xaxis.tick_bottom()
ax.yaxis.tick_left()
ax.tick_params(colors='gray',direction='out')
for tick in ax.get_xticklabels():
tick.set_color('gray')
for tick in ax.get_yaxislabels():
tick.set_color('gray')
ax.hist(x,edgecolor='E6E6E6',color='E6E6E6');
Run Code Online (Sandbox Code Playgroud)
错误是:AttributeError:未知属性axisbg
请帮助我确定错误。
考虑以下简单模块:
module Fail1 where
identity x = x
module Main where
import Fail1
main = print (identity 7)
Run Code Online (Sandbox Code Playgroud)
我将这些另存为Fail1.hs和Fail2.hs。如果我尝试运行该程序,一切都很好:
> runhaskell Fail2
7
Run Code Online (Sandbox Code Playgroud)
但是看看这个:
> ghc -O2 --make Fail1
[1 of 1] Compiling Fail1 ( Fail1.hs, Fail1.o )
> runhaskell Fail2
_
Run Code Online (Sandbox Code Playgroud)
该程序现在永久挂起,ghc.exe消耗了一个CPU内核的100%。有没有搞错?
它会变得更好:
> ghc -O2 --make Fail2
[2 of 2] Compiling Main ( Fail2.hs, Fail2.o )
> runhaskell Fail2
Access violation in generated code when reading 0xffffffffffffffff
Attempting to reconstruct a stack …Run Code Online (Sandbox Code Playgroud) runtime-error ×10
android ×2
java ×2
apache-felix ×1
c# ×1
camera ×1
debugging ×1
for-loop ×1
function ×1
garrys-mod ×1
ghc ×1
haskell ×1
ios ×1
javascript ×1
libc ×1
lua ×1
matplotlib ×1
next ×1
osgi ×1
python ×1
undefined ×1
wcf ×1