javascript error in Mozilla Firefox 1.5.0.1

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

javascript error in Mozilla Firefox 1.5.0.1

Postby senthilmca » Tue 07 Mar, 2006 9:11 am

hai! I got an error while running this code. Please provide solutionit. Thanks


CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Mozilla Test </TITLE>

<script language="javascript">

function call(){
alert("Inside Call");
var idVal=document.getElementById("f1").t1.value;
alert(idVal);
}
</script>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<form name="f1">
<input type="text" name="t1" size=20>
<input type="text" name="t2" onClick="call()">
</BODY>
</HTML>


Error Thrown in Javascript Console



Error: [Exception... "'Permission denied to set property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup::selectedIndex]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: file:///C:/javascript/mozillatest.html :: call :: line 9" data: no]
Source File: file:///C:/javascript/mozillatest.html Line: 9


Error: document.getElementById("f1") has no properties
Source File: file:///C:/javascript/mozillatest.html Line: 10
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
senthilmca
junior member
junior member
 
Posts: 6
Joined: Wed 15 Feb, 2006 10:07 am

Postby akbash » Tue 07 Mar, 2006 11:37 pm

The first error you mention, permission denied in nsIAutoCompletePopup::selectedIndex, is a problem internal to the browser. It happens when you call for that first debugging alert(), and it seems to have something to do with calling alert() within an event handler on a text field. These things come and go in Firefox. In short, it's not your fault, it doesn't seem to have any real effect, and you need not worry about it.

The second error you mention, element has no properties, is happening because document.getElementById() finds elements by their |id| property, not by their |name| property. Your HTML sample contains no element with an id of "f1".
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060305 Firefox/1.5
akbash
silver member
silver member
 
Posts: 364
Joined: Mon 09 Feb, 2004 9:13 pm

I found the solution here

Postby onoi » Mon 15 Jan, 2007 2:31 am

Please visit this link for your solution:

http://www.webmasterworld.com/javascript/3100508.htm
UserAgent: Opera/9.10 (Windows NT 5.1; U; en)
onoi
new member
new member
 
Posts: 1
Joined: Sun 14 Jan, 2007 9:36 pm


Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot]