473,792 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox kills option.value white-space

Hi,

Can someone please show me how to tell Firefox to preseve white-space when
returning the selectList.opti on[n].value attribute?

I have change the style so that the white-space is preserved on the screen,
but for some bizarre reason when I try to substring out a series of bytes
(aka a fixed-length string or field) from a given option it squashes
everything up and corrupts the result.

Cheers Richard Maher

BTW. Works fine on IE.
Jul 3 '07 #1
5 2576
On Jul 3, 3:44 pm, "Richard Maher" <maher...@hotsp amnotmail.com>
wrote:
Hi,

Can someone please show me how to tell Firefox to preseve white-space when
returning the selectList.opti on[n].value attribute?

I have change the style so that the white-space is preserved on the screen,
but for some bizarre reason when I try to substring out a series of bytes
(aka a fixed-length string or field) from a given option it squashes
everything up and corrupts the result.
The value of an option element is CDATA[1], about which the W3C HTML 4
specification says:

"User agents may ignore leading and trailing white space
in CDATA attribute values (e.g., " myval " may be
interpreted as "myval"). Authors should not declare attribute
values with leading or trailing white space."

<URL: http://www.w3.org/TR/html4/types.html#type-cdata >

BTW. Works fine on IE.
Hooray for IE, however both IE and Firefox are consistent with the
spec.
1. <URL: http://www.w3.org/TR/html4/interact/...f-value-OPTION
>
--
Rob

Jul 3 '07 #2
Hi Rob,

Thanks for the reply.
The value of an option element is CDATA[1], about which the W3C HTML 4
specification says:
[ambiguous non-committal crap :-]

Anyway, I was able to work out that my x.options[x.length] = new
Option(string,p os) should've been (string,string) and then if I returned the
options[n].VALUE rather than .TEXT I managed to get the white-space intact.

Just another part of browsers' rich tapestry I suppose :-)

Please bear with me as there's bound to be a few more of these. I'm not an
IE (or Microsoft) lover, but (at first glance) Firefox doesn't seem to be
all it's cracked up to be. How do you get Firebug going 'cos at least IE
gave you the line number it barfed at. (Come to think of it, at least it
barfed in the first place and let you double-click on the error rather than
this Firefox deathly silence)

Cheers Richard Maher

"RobG" <rg***@iinet.ne t.auwrote in message
news:11******** *************@g 37g2000prf.goog legroups.com...
On Jul 3, 3:44 pm, "Richard Maher" <maher...@hotsp amnotmail.com>
wrote:
Hi,

Can someone please show me how to tell Firefox to preseve white-space
when
returning the selectList.opti on[n].value attribute?

I have change the style so that the white-space is preserved on the
screen,
but for some bizarre reason when I try to substring out a series of
bytes
(aka a fixed-length string or field) from a given option it squashes
everything up and corrupts the result.

The value of an option element is CDATA[1], about which the W3C HTML 4
specification says:

"User agents may ignore leading and trailing white space
in CDATA attribute values (e.g., " myval " may be
interpreted as "myval"). Authors should not declare attribute
values with leading or trailing white space."

<URL: http://www.w3.org/TR/html4/types.html#type-cdata >

BTW. Works fine on IE.

Hooray for IE, however both IE and Firefox are consistent with the
spec.
1. <URL: http://www.w3.org/TR/html4/interact/...f-value-OPTION
--
Rob


Jul 3 '07 #3
"Richard Maher" <ma******@hotsp amnotmail.comwr ote:
How do you get Firebug going 'cos at least IE
gave you the line number it barfed at. (Come to think of it, at least
it barfed in the first place and let you double-click on the error
rather than this Firefox deathly silence)
If you get a javascript error then firebug will tell you this in red near
the right hand end of the status bar. e.g. '1 Error'. Click on this and it
will open Firebug's console view (or open firebug with F12 and select the
console view manually). Once in the console view you should be able to see
the error message.

A lot of things in Firebug's console are clickable: click on the line
number associated with an error message and it jumps you to the relevant
line in the debugger, click on an object value and you can browse its
properties. Use console.log to output clickable objects in tracing
statements:

console.log('Fo obar current value is %o', foobar);

Also at the console prompt you can type in an expression and again the
result (if it isn't just a simple value) can be clicked on and browsed.
Jul 3 '07 #4
Hi Duncan,

"Duncan Booth" wrote: -
A lot of things in Firebug's console are clickable: click on the line
number associated with an error message and it jumps you to the relevant
line in the debugger, click on an object value and you can browse its
properties. Use console.log to output clickable objects in tracing
statements:
Now this is excellent! Thanks for the pointer.

I had to get the console up via "tools/error console" but now I'm there and
love what I see so far.

Cheers Richard Maher

"Duncan Booth" <du**********@i nvalid.invalidw rote in message
news:Xn******** *************** *@127.0.0.1...
"Richard Maher" <ma******@hotsp amnotmail.comwr ote:
How do you get Firebug going 'cos at least IE
gave you the line number it barfed at. (Come to think of it, at least
it barfed in the first place and let you double-click on the error
rather than this Firefox deathly silence)

If you get a javascript error then firebug will tell you this in red near
the right hand end of the status bar. e.g. '1 Error'. Click on this and it
will open Firebug's console view (or open firebug with F12 and select the
console view manually). Once in the console view you should be able to see
the error message.

A lot of things in Firebug's console are clickable: click on the line
number associated with an error message and it jumps you to the relevant
line in the debugger, click on an object value and you can browse its
properties. Use console.log to output clickable objects in tracing
statements:

console.log('Fo obar current value is %o', foobar);

Also at the console prompt you can type in an expression and again the
result (if it isn't just a simple value) can be clicked on and browsed.

Jul 4 '07 #5
"Richard Maher" <ma******@hotsp amnotmail.comwr ote:
>
"Duncan Booth" wrote: -
>A lot of things in Firebug's console are clickable: click on the line
number associated with an error message and it jumps you to the
relevant line in the debugger, click on an object value and you can
browse its properties. Use console.log to output clickable objects in
tracing statements:

Now this is excellent! Thanks for the pointer.

I had to get the console up via "tools/error console" but now I'm
there and love what I see so far.
That's a different error console. Tools/error console gives you the
standard Firefox error console. Tools/firebug/open firebug will give you
firebug (assuming you have it installed - if not, install it now).
Jul 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
1505
by: eroot | last post by:
Please help! This is the last coding hurdle before I am done with the site I am presently working on. It seems like this should work, but it isn't. (What is suppose to happen: when you select the option you want from the drop down menu the appropriate <div> becomes visible). I have put in some alerts to see where the code is failing, and for some reason in Netscape it isn't completing the sequence. It seems like it should be easy to...
8
8442
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript"> function clicks() { document.getElementById("t1").value =
2
2475
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only click on the Unplatted Radio button, the rest isn't functional, yet. Any ideas how to make these drop down in FF. This works in IE. Here is the code: <HTML> <HEAD> <TITLE>Door County Register of Deeds - Tract Inquiry</TITLE>
11
2818
by: davecph | last post by:
I'm constructing a website with a layout created with div-tags. They have a fixed width, float left, and display inline. When one of the div's contain a select-element the right-most div floats down for no apparent reason, but when the select-elements are gone they all align as expected. No css apply to the select-elements. image of prob.: http://sdc.novasol.com/site/nov/TMP/withSelectBoxes.gif image of expected:...
1
8035
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the flash window comes above the iframe area the html links stop working. Yet the links remain active when the flash window is outside the iFrame area. This problem is coming in Firefox, but running fine in IE. If anybody has any solution, please...
1
2569
flexsingh
by: flexsingh | last post by:
Hello there I have kinda got gotten myself into a sticky situation. I am trying to do something which seams too big to do in my head but I feel I kinda know how to do it. My problem is I have a website and and users come in and book a court. There are three courts, and on the first page ill have up its a table which they choose which court they want then they go to a new page which is also a table. The second page has three values to fill...
3
2434
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,...
1
2032
by: ehud37new | last post by:
this script work fine in IE but not in FireFox where is the problem? here is the script /*------------------------------------------------------------------ File: menu.js Use: Collection of clients functions
1
3659
by: sva0008 | last post by:
i have a auto suggest script that does not work in firefox , works great on IE. /******************************************************* AutoSuggest - a javascript automatic text input completion component Copyright (C) 2005 Joe Kepley, The Sling & Rock Design Group, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software...
7
4046
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. Before there are six characters entered in the CAPTCHA code field, the 'Send' button is supposed to be disabled. When there are at least six characters in the CAPTCHA code field, the script attempts to verify the CAPTCHA w/AJAX. If it verifies, it...
0
9518
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
10430
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
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
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.