开发者

Getting Unknown error In IE8

In IE8 I am facing an issue while calling a method through an object.

The following is the code snippet

gen.js

function getmystring()
{

}

function DispString()
{
   var  = this.getmystring(); // while executing this line, we are getting Unknown error
   ...
   ...
   ...
}

......
......
......



var mystring_Def = {
global: {
    cur: null
},
//constructor defs
constructor: {
...
...
...
},
//properties defs which contains getmystring & DispString
...
...
...
}
};

my html contains the following code snippet

<HTML>
<HEAD>
...
...
...

<SCRIPT LANGUAGE="Javascript" SRC="gen.js"> </SCRIPT>
<SCRIPT LANGUAGE="Javascript">
var abc = mystring_Def.global.cur; // mystring_Def.global.cur is intialized before calling this page
document.writeln(DispString());

...
...
...
</BODY>
</HTML>

mystring_Def is initialized in some other script.

I am getting "Unknown exception" when calling this.getmystring().

If call the me开发者_运维知识库thod getmystring() in an html page, it is working fine, but I am getting error when i am calling in DispString().

I checked whether this is constructed or not using typeof, and itt is showing as function. Using this i can access other properties except function objects.

The above code is working fine in IE6 and IE7, but failing in IE8.

It would be gratefyl if anyone give some pointers to solve the above problem.


try passing this as a parameter too. this will create reference to current object.Problem which I think is ,this doesn't reference to anything while this.getmystring() is called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜