473,698 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox problem

1 New Member
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.appNa me;

document.write( " username:" + document.getEle mentById("logus ername").value) ;
document.write( " password:" + document.getEle mentById("passw ord").value);
document.write( " hit Back button to return to the website");
}


In IE it displays all the "document.w rite commands", where as in firefoxt it only displays the 1st document.write command, and completely ignores others.
Apr 1 '07 #1
1 967
AricC
1,892 Recognized Expert Top Contributor
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.appNa me;

document.write( " username:" + document.getEle mentById("logus ername").value) ;
document.write( " password:" + document.getEle mentById("passw ord").value);
document.write( " hit Back button to return to the website");
}


In IE it displays all the "document.w rite 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
5021
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 :: file:///C:/Documents%20and%20Settings/Edd/Desktop/test.html :: valText :: line 24" data: no] Source File: file:///C:/Documents%20and%20Settings/Edd/Desktop/test.html Line: 24 Anyone have any ideas as to why this is happening?
12
1938
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 (in)validate my Javascript code. First, I'll describe the purpose of the Javascript code. I often have a need to post a URL to something at my own web site, e.g., http://www.standards.com/Sorting/SortPerformanceComparison-Description.html. It is...
3
2089
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 browser. Anyone seen this problem or have any ideas why this might be occurring ?? (I have web.config browsercaps updated from http://slingfive.com/ ) code: =========
6
14456
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 postback code, but I have a workaround for that installed (and it looks like the code generated by ASP.NET when it renders the page does the same thing, namely, setting document<). However, the problem still exists under firefox. Has anyone come...
4
2160
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 willing to check my website with Firefox. Sounds like I might have a float problem/div problem that is visible to Firefox users only Here is my problem: >From my PC and majority of viewers of my webpage they see the Flickr badge (photos) on the...
4
2155
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 broken in Firefox 1.5.0.1 on OS X. What happens with the Scriptaculous library is this In the html document the author only has to include one line
13
2870
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 here: http://s161149005.onlinehome.us/DEMOS/FF/RESIZE_PROB/main/frameset.asp It works fine in IE 6, but in Firefox, it is broken. Specifically, when the page/frameset first loads in either browser, it looks correct. But when you click the...
11
3429
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 no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console shows that there are numerous errors occuring. It looks like the web browser does not recognise...
7
2535
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
2426
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 couple of the Firefox is munging up. So, on my information page there is a gridview in the content section of the page. The masterpage contains searching capabilities for the gridview. The masterpage has controls contained in a panel control,...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.