473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Firefox problem

Hi guys can anyone tell me why this code works in Internet Explorer and not in Firefox? and how i can go about fixing the incompatibility problem ?

CODE::

function formLogin(){

var bName = navigator.appName;

document.write(" username:" + document.getElementById("logusername").value);
document.write(" password:" + document.getElementById("password").value);
document.write(" hit Back button to return to the website");
}


In IE it displays all the "document.write commands", where as in firefoxt it only displays the 1st document.write command, and completely ignores others.
Apr 1 '07 #1
1 959
AricC
1,892 Expert 1GB
Hi guys can anyone tell me why this code works in Internet Explorer and not in Firefox? and how i can go about fixing the incompatibility problem ?

CODE::

function formLogin(){

var bName = navigator.appName;

document.write(" username:" + document.getElementById("logusername").value);
document.write(" password:" + document.getElementById("password").value);
document.write(" hit Back button to return to the website");
}


In IE it displays all the "document.write commands", where as in firefoxt it only displays the 1st document.write command, and completely ignores others.
Hi MarkyMark welcome to TSDN!
Try something along these lines:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.     <html>
  3.         <head>
  4.             <title>Test</title>
  5.           <script type="text/javascript">
  6.         function WriteSomething()
  7.         {
  8.         var strUsername = document.getElementById("txtUserName").value
  9.         var strPassword = document.getElementById("txtPassword").value
  10.  
  11.         document.write("Username: " + strUsername + "<br />")
  12.         document.write("Password: " + strPassword + "<br />")
  13.         document.write("Your Username and Pass are above")
  14.  
  15.         }
  16.         </script>
  17.         </head>
  18.             <body>
  19.         <form name="frmTest" action="#">
  20.         <input type="text" id="txtUserName" size="25" />
  21.         <input type="text" id="txtPassword" size="25" />
  22.         <input type="button" onclick="WriteSomething()" size="25" value="Click Me" />  
  23.           </body>
  24. </html>
  25.  
Apr 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Geoff | last post by:
When trying to focus a field in Firefox, I get the following error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::...
12
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can...
3
by: TJS | last post by:
I am finding that the serverside requiredvalidator doesn't fire in the firefox browser, and user request proceeds through to my updateProfile method. Validation is working correctly in the IE...
6
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
4
by: dsimmons | last post by:
On my website http://seasidequilters.blogspot.com/ I'm having a problem that someone thinks might be associated with Firefox browsers. I'm hoping to find someone in this forum that might be...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
13
by: Giggle Girl | last post by:
Hi there, I am having a problem with the behavior of Firefox, where lefthand column content is not resized properly after it is "collapsed" and then "re-expanded". An online demo is available...
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
7
by: Carlos Mendonça | last post by:
Has anyone managed to get ClickOnce to work with Firefox? It seems to me that it still has the same issues VS 2K5 had. I appreciate any comments or tips.
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.