Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Issues with javascript
Posted by: Jeff
Date: October 03, 2003 06:39PM

I'm noticing that some folks are using my web application with K-meleon lately and it has been throwing some errors. All of them are in relation to the javascript I have on the pages. For instance, the following will not focus to the text input field when the page loads:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body onload="document.frmMain.FirstName.select(); document.frmMain.FirstName.focus();">

<form name="frmMain" method="post" action="test.asp">

<input type="text" name="FirstName" value="">

</form>

</body>

I have some other issues, but I will start with this one first. Thanks for any help!

Jeff

Options: ReplyQuote
Re: Issues with javascript
Posted by: boogomatic
Date: October 04, 2003 04:56AM

It doesn't seem to be a javascript problem, it may that K-Meleon takes focus away from the page on load.

Tried this preference but it didn't help.

user_pref("kmeleon.display.NewWindowHasUrlFocus", false);

This page works:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Form Select Test</title>

<script type="text/javascript">

function frmFocus()
{
document.frmMain.FirstName.select();
document.frmMain.FirstName.focus();
}

</script>

</head>

<body onLoad="setTimeout('frmFocus()',0)">

<form name="frmMain" method="post" action="test.asp">

<input type="text" name="FirstName" value="Form Select Test">

</form>

</body>

</html>

But if this:

<body onLoad="setTimeout('frmFocus()',0)">

Is changed to this:

<body onLoad="frmFocus()">

It does'nt work?

boogomatic

Options: ReplyQuote


K-Meleon forum is powered by Phorum.