473,407 Members | 2,359 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,407 software developers and data experts.

Alternative to eval

This is a very simplified example of an Intranet application. But, is there an
easier (or more efficient) way of getting the decimal equivalent of a fraction?

The actual function gets the select values, this one is a simplified version
where its passed.

function checkIt(selVal){
valueInDec1 = eval(selVal);
//do some calculations here with valueInDec1
}

<select onchange="checkIt(this.value)">
<option value="0">0</option>
<option value="1/16">1/16</option>
<option value="1/8">1/8</option>
...............
<option value="7/8">7/8</option>
<option value="15/16">15/16</option>
</select>

I know that I could change it and have it look up the decimal equivalent for
the fraction, with an Object or an Array. I could also split the value on the /
and convert them to numbers, do the division, and get the decimal.

I discounted the Object/Array approach (and may go back to it, but doubt it).
The reason is that its not just 16ths. Some of the selects are 37ths, some are
7ths, one of them has 128ths in it. Simply put, I don't think that maintaining
10+ objects to contain the decimals is efficient (but open to that approach).
Also, its subject to get some added (different denominators), and some removed.

The split approach just doesn't seem to be as efficient though.

function checkIt(selVal){
myNumber = selVal.split('/')
decimalForm = parseFloat(myNumber[0])/parseFloat(myNumber[1])
//do some calculations here with valueInDec1
}

When the form gets submitted, it has to be in fractional form. I have no
control over the way the selects get generated so I am kind of stuck trying to
do it client side.

Thoughts, suggestions, comments?
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #1
9 8447
Lee
HikksNotAtHome said:

This is a very simplified example of an Intranet application. But, is there an
easier (or more efficient) way of getting the decimal equivalent of a fraction?

The actual function gets the select values, this one is a simplified version
where its passed.

function checkIt(selVal){
valueInDec1 = eval(selVal);
//do some calculations here with valueInDec1
}

<select onchange="checkIt(this.value)">
<option value="0">0</option>
<option value="1/16">1/16</option>
<option value="1/8">1/8</option>
..............
<option value="7/8">7/8</option>
<option value="15/16">15/16</option>
</select>

The most efficient solution would seem to be:

<select onchange="checkIt(this.value)">
<option value="0">0</option>
<option value="0.0625">1/16</option>
<option value="0.125">1/8</option>
...............
<option value="0.875">7/8</option>
<option value="0.9375">15/16</option>
</select>

Jul 20 '05 #2
In article <bh*********@drn.newsguy.com>, Lee <RE**************@cox.net>
writes:
The most efficient solution would seem to be:

<select onchange="checkIt(this.value)">
<option value="0">0</option>
<option value="0.0625">1/16</option>
<option value="0.125">1/8</option>
..............
<option value="0.875">7/8</option>
<option value="0.9375">15/16</option>
</select>


I agree with you 100%. I have no control over how the select is generated
though. If I loop through the select and options and programatically change
them to decimals, I have to convert them back to fractions (or, swap them with
the text of the option) so that when the form gets submitted, I get the
fraction instead of the decimal. The eval still seems to be more efficient
though, in the end. ::sigh::
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #3
On 17 Aug 2003 17:55:11 GMT, hi************@aol.com (HikksNotAtHome)
wrote:
This is a very simplified example of an Intranet application. But, is there an
easier (or more efficient) way of getting the decimal equivalent of a fraction?

I know that I could change it and have it look up the decimal equivalent for
the fraction, with an Object or an Array. I could also split the value on the /
and convert them to numbers, do the division, and get the decimal.

I discounted the Object/Array approach (and may go back to it, but doubt it).
The reason is that its not just 16ths. Some of the selects are 37ths, some are
7ths, one of them has 128ths in it. Simply put, I don't think that maintaining
10+ objects to contain the decimals is efficient (but open to that approach).
Also, its subject to get some added (different denominators), and some removed.

The split approach just doesn't seem to be as efficient though.

function checkIt(selVal){
myNumber = selVal.split('/')
decimalForm = parseFloat(myNumber[0])/parseFloat(myNumber[1])
//do some calculations here with valueInDec1
}

When the form gets submitted, it has to be in fractional form.


The Object/Array approach involves a fair bit of overhead, either in
download time if all the contents are hardcoded, or time if they are
generated at some point.

As far as parsing the string goes, I've always considered compiled
code to be faster than script-based parsing; split may not do as bad
as you think.

Usually I recommend against using eval because there is almost always
a clearly better way of accomplishing the goal, but in this case I
suspect eval will be equal to or better than any other method, plus,
it appears that the input strings are static, so I think eval is the
way to go.

Regards,
Steve
Jul 20 '05 #4
"HikksNotAtHome" <hi************@aol.com> wrote in message
news:20***************************@mb-m21.aol.com...
<snip>
function checkIt(selVal){
valueInDec1 = eval(selVal);
//do some calculations here with valueInDec1
}
If you just want to avoid the word "eval" appearing in your source code
you could use:-

valueInDec1 = new Function ('return ('+selVal+');')();

- but that will perform worse that eval. And the Function constructor
will probably use eval internally so it is really no more than avoiding
eval by name.

<snip> function checkIt(selVal){
myNumber = selVal.split('/')
decimalForm = parseFloat(myNumber[0])/parseFloat(myNumber[1])
//do some calculations here with valueInDec1
}


Unary + is about 4 times faster at string to number conversion than
parseFloat, so:-

decimalForm = (+myNumber[0])/(+myNumber[1]);

-should be fractionally quicker. But then the division operator requires
numeric operands so it will type-convert anyway so just:-

decimalForm = (myNumber[0]/myNumber[1]);

- will do.

Generally I can't think of a non-eval approach that is better than the
split-and-divide function above.

Richard.
Jul 20 '05 #5
In article <bh*******************@news.demon.co.uk>, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> writes:
Unary + is about 4 times faster at string to number conversion than
parseFloat, so:-

decimalForm = (+myNumber[0])/(+myNumber[1]);

-should be fractionally quicker. But then the division operator requires
numeric operands so it will type-convert anyway so just:-

decimalForm = (myNumber[0]/myNumber[1]);
The difference I see, in testing, of these two:

decimalForm = (myNumber[0]/myNumber[1]);
decimalForm = parseFloat(myNumber[0])/parseFloat(myNumber[1])

Is in the 50-60 ms range, on 400-500 ms, The more passes, the stranger the
results get.
- will do.

Generally I can't think of a non-eval approach that is better than the
split-and-divide function above.


Changing the test that I posted to
decimalForm = (myNumber[0]/myNumber[1]);
instead of the parseFloat's, I still get 440-500 milliseconds on 10,000 passes.

I do see a difference with/without the parseFloat though (about 50-60
milliseconds on 10,000 passes).

With eval, I get in the range of 110 - 220. Which actually makes eval faster
than the split/divide method in any form.

Upping it to 50,000 passes, I get these results:

Test1:
eval took 1100 milliseconds
split took 8070 milliseconds
split with parseFloat took 8020 milliseconds
split with parseInt took 8020 milliseconds

Test2:
eval took 1050 milliseconds
split took 7960 milliseconds
split with parseFloat took 8020 milliseconds
split with parseInt took 8180 milliseconds

Test3:
eval took 1090 milliseconds
split took 7910 milliseconds
split with parseFloat took 8080 milliseconds
split with parseInt took 8020 milliseconds

Test4:
eval took 550 milliseconds
split took 7860 milliseconds
split with parseFloat took 7960 milliseconds
split with parseInt took 7970 milliseconds

Test5:
eval took 1040 milliseconds
split took 8130 milliseconds
split with parseFloat took 8020 milliseconds
split with parseInt took 8130 milliseconds

The test page I used can be found at:
<URL: http://members.aol.com/hikksnotathom...est/index.html />
Its set at 50,000 passes, view-source: may be a better way to get to it than
letting it potentially lock up a browser.
I added a 4th test, using parseInt instead of parseFloat, just for
kicks/giggles.

I had a new Function test in it but it was killing it, 11,000+ milliseconds (as
you guessed it would do), so I took it out.

But I wasn't avoiding eval for the sake of avoiding it. When I first tried it,
I actually expected it to be slower, and got to looking at it, and thinking
about what it was actually doing, and then started testing it. Saw where eval
was faster, so I wanted other opinions on it. There may even be a flaw in my
test itself?
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #6
"HikksNotAtHome" <hi************@aol.com> wrote in message
news:20***************************@mb-m06.aol.com...
<snip>
alerts 330 and 500 for me, which indicates eval is faster. But
thats on a 2.2 Ghz Machine with 256mbs Ram. Will test it again
tomorrow at work, on a slower machine, just to see how much
difference it makes. But it can only make a bigger difference.

<snip>

It looks to me like the results vary considerably depending on the
browser. For IE eval is quickest, on Opera 7 and Mozilla 1.3 split
followed by division comes out on top (500 Mhz PIII Win 98).

Taking:-
myNumber = tempObj[c].split('/')
N = myNumber[0]/myNumber[1];
- as the basis for comparison (100% on each browser)
IE = 100%
Op = 100%
Mz = 100%

myNumber = tempObj[c].split('/')
N = (+myNumber[0])/(+myNumber[1]);
IE = 98.74%
Op = 98.36%
Mz = 100%

myNumber = tempObj[c].split('/')
N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);
IE = 108.26%
Op = 118.03%
Mz = 109.52%

N = eval(tempObj[i]);
IE = 17.50%
Op = 154.10%
Mz = 122.22%

N = new Function('return ('+tempObj[i]+');')();
IE = 163.58%
Op = 286.88%
Mz = 152.38%

For comparison, this is my test page:-

<html>
<head>
<title></title>
<script type="text/javascript">
var frm = null;
var fncts = ['emptyL','evalVersion','FunctionObject',
'splitNparseFloat','splitNunaryPlus','splitNdivide '];
var running = false;

function setButtons(bl){
frm['loopLimit'].disabled = bl;
var sw = frm['bt'];
if(typeof sw.length == 'undefined'){
sw = [sw];
}
for(var c = 0;c < sw.length;c++){
sw[c].disabled = bl;
}
}

var tempObj = new Object();
function doTests(){
if(!running){
var t = ['','/',''];
frm = document.forms['f'].elements;
setButtons(true);
t[2] = +frm['loopLimit'].value;

for (var k=0;k<t[2];k++){
t[0] = k;
tempObj[k]= t.join('');
}
frm["Dur0"].value = '';frm["Avr0"].value = '';
for(var c = 1;c < fncts.length;c++){
frm["Dur"+c].value = '';
frm["Avr"+c].value = '';
frm["CAvr"+c].value = '';
frm["PAvr"+c].value = '';
frm["Res"+c].value = '';
}
running = true;
act(0);
}
}
function act(p){
/* setTimeout is used to minimise the occurrences
of 'a script on this page is running slow' dialogs. */
if(p >= fncts.length){
setTimeout('report()',100);
}else{
setTimeout((fncts[p]+'('+p+');'),200);
}
}
function report(){
var lim = +frm['loopLimit'].value;
var emDur = +frm["Dur0"].value
var unaC = (frm["Dur"+(fncts.length-1)].value - emDur) / lim;
frm["CAvr"+(fncts.length-1)].value = unaC;
frm["PAvr"+(fncts.length-1)].value = '100';
for(var c = 1;c < (fncts.length-1);c++){
if(frm["Cb"+c].checked){
var evaC = (frm["Dur"+c].value - emDur) / lim;
frm["CAvr"+c].value = evaC;
frm["PAvr"+c].value = ((evaC/unaC)*100);
}else{
frm["CAvr"+c].value = 'X';
frm["PAvr"+c].value = 'X';
}
}
setButtons(false);
running = false;
}
function emptyL(p){
var lim = +frm['loopLimit'].value;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
;
}
totTime = (new Date().getTime() - stTime)
frm["Dur0"].value = totTime;
frm["Avr0"].value = (totTime/lim);
act(p+1);
}
function evalVersion(p){
if(frm['Cb'+p].checked){
var lim = +frm['loopLimit'].value;
var N;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
N = eval(tempObj[c]);
}
totTime = (new Date().getTime() - stTime)
frm["Dur"+p].value = totTime;
frm["Avr"+p].value = (totTime/lim);
frm["Res"+p].value = N;
}else{
frm["Dur"+p].value = 'X';
frm["Avr"+p].value = 'X';
frm["Res"+p].value = 'X';
}
act(p+1);
}
function FunctionObject(p){
if(frm['Cb'+p].checked){
var lim = +frm['loopLimit'].value;
var N;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
N = new Function('return ('+tempObj[c]+');')();
}
totTime = (new Date().getTime() - stTime)
frm["Dur"+p].value = totTime;
frm["Avr"+p].value = (totTime/lim);
frm["Res"+p].value = N;
}else{
frm["Dur"+p].value = 'X';
frm["Avr"+p].value = 'X';
frm["Res"+p].value = 'X';
}
act(p+1);
}
function splitNparseFloat(p){
if(frm['Cb'+p].checked){
var lim = +frm['loopLimit'].value;
var N,temp;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
temp = tempObj[c].split('/')
N = parseFloat(temp[0])/parseFloat(temp[1]);
}
totTime = (new Date().getTime() - stTime)
frm["Dur"+p].value = totTime;
frm["Avr"+p].value = (totTime/lim);
frm["Res"+p].value = N;
}else{
frm["Dur"+p].value = 'X';
frm["Avr"+p].value = 'X';
frm["Res"+p].value = 'X';
}
act(p+1);
}
function splitNunaryPlus(p){
if(frm['Cb'+p].checked){
var lim = +frm['loopLimit'].value;
var N,temp;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
temp = tempObj[c].split('/')
N = (+temp[0])/(+temp[1]);
}
totTime = (new Date().getTime() - stTime)
frm["Dur"+p].value = totTime;
frm["Avr"+p].value = (totTime/lim);
frm["Res"+p].value = N;
}else{
frm["Dur"+p].value = 'X';
frm["Avr"+p].value = 'X';
frm["Res"+p].value = 'X';
}
act(p+1);
}
function splitNdivide(p){
if(frm['Cb'+p].checked){
var lim = +frm['loopLimit'].value;
var N,temp;
var totTime,stTime = new Date().getTime();
for(var c = 0;c < lim;c++){
temp = tempObj[c].split('/')
N = temp[0]/temp[1];
}
totTime = (new Date().getTime() - stTime)
frm["Dur"+p].value = totTime;
frm["Avr"+p].value = (totTime/lim);
frm["Res"+p].value = N;
}else{
frm["Dur"+p].value = 'X';
frm["Avr"+p].value = 'X';
frm["Res"+p].value = 'X';
}
act(p+1);
}
</script>
</head>
<body>
<p>
<form name="f" action="#">
Loop Length = <input type="text" value="50000"
name="loopLimit"> Some browsers will put up an &quot;A script on
this page is making the browser run slowly&quot; dialog. If this
happens the results for the test will be invalid and a shorter loop
will be needed. However, JavaScript Date objects do not tend to be
accurate to less than 10 milliseconds so duration results that are
not different by at least 20 milliseconds (and preferably 100+) are
not necessarily meaningful and a longer loop may be needed to acquire
useful results.<br><br>
<input type="button" value="Test" name="bt" onclick="doTests();">
Repeat tests to reduce/expose the influence of background tasks.
<br><br>
Empty Loop Duration (milliseconds) = <input type="text" value="X"
name="Dur0"><br>
Empty Loop Average (milliseconds) = <input type="text" value="X"
name="Avr0" size="22"><br><br>
Test <code>N = eval(tempObj[i]);</code> ? <input type="checkbox"
name="Cb1" checked><br>
<code>N = eval(tempObj[i]);</code> Duration (milliseconds) =
<input type="text" value="X" name="Dur1"><br>
<code>N = eval(tempObj[i]);</code> Average (milliseconds) =
<input type="text" value="X" name="Avr1" size="22"><br>
(result = <input type="text" value="X" name="Res1" size="22">)<br><br>
Test <code>N = new Function('return ('+tempObj[i]+');')();</code> ?
<input type="checkbox" name="Cb2"><br>
<code>N = new Function('return ('+tempObj[i]+');')();</code>
Duration (milliseconds) = <input type="text" value="X"
name="Dur2"><br>
<code>N = new Function('return ('+tempObj[i]+');')();</code>
Average (milliseconds) = <input type="text" value="X"
name="Avr2" size="22"><br>
(result = <input type="text" value="X" name="Res2" size="22">)<br><br>
Test <code>N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);</code>
? <input type="checkbox" name="Cb3" checked><br>
<code>N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);</code>
Duration (milliseconds) = <input type="text" value="X"
name="Dur3"><br>
<code>N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);</code>
Average (milliseconds) = <input type="text" value="X"
name="Avr3" size="22"><br>
(result = <input type="text" value="X" name="Res3" size="22">)<br><br>
Test <code>N = (+myNumber[0])/(+myNumber[1]);</code> ? <input
type="checkbox" name="Cb4" checked><br>
<code>N = (+myNumber[0])/(+myNumber[1]);</code>
Duration (milliseconds) = <input type="text" value="X"
name="Dur4"><br>
<code>N = (+myNumber[0])/(+myNumber[1]);</code>
Average (milliseconds) = <input type="text" value="X"
name="Avr4" size="22"><br>
(result = <input type="text" value="X" name="Res4" size="22">)<br><br>
Test <code>N = myNumber[0]/myNumber[1];</code> ?
<input type="checkbox" name="Cb5" checked><br>
<code>N = myNumber[0]/myNumber[1];</code>
Duration (milliseconds) = <input type="text" value="X"
name="Dur5"><br>
<code>N = myNumber[0]/myNumber[1];</code>
Average (milliseconds) = <input type="text" value="X"
name="Avr5" size="22"><br>
(result = <input type="text" value="X" name="Res5" size="22">)<br><br>
<input type="button" value="Test" name="bt" onclick="doTests();">
Repeat tests to reduce/expose the influence of background tasks.
<br><br>
Results: (duration of test - duration of empty loop) / loop length<br>
<code>N = eval(tempObj[i]);</code> Average (milliseconds) =
<input type="text" value="X" name="CAvr1" size="22"><br>
<code>N = new Function('return ('+tempObj[i]+');')();</code>
Average (milliseconds) = <input type="text" value="X"
name="CAvr2" size="22"><br>
<code>N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);</code>
Average (milliseconds) = <input type="text" value="X"
name="CAvr3" size="22"><br>
<code>N = (+myNumber[0])/(+myNumber[1]);</code> Average (milliseconds)
= <input type="text" value="X" name="CAvr4" size="22"><br>
<code>N = myNumber[0]/myNumber[1];</code> Average (milliseconds) =
<input type="text" value="X" name="CAvr5" size="22"><br><br>
Differences (<code>((Math.round(Math.random()))||-1)</code> = 100%)
<br><code>N = eval(tempObj[i]);</code> = <input type="text" value="X"
name="PAvr1" size="22">%<br>
<code>N = new Function('return ('+tempObj[i]+');')();</code> =
<input type="text" value="X" name="PAvr2" size="22">%<br>
<code>N = parseFloat(myNumber[0])/parseFloat(myNumber[1]);</code> =
<input type="text" value="X" name="PAvr3" size="22">%<br>
<code>N = (+myNumber[0])/(+myNumber[1]);</code> = <input type="text"
value="X" name="PAvr4" size="22">%<br>
<code>N = myNumber[0]/myNumber[1];</code> = <input type="text"
value="X" name="PAvr5" size="22">%<br>
</form>
</p>
</body>
</html>

Richard.
Jul 20 '05 #7
JRS: In article <20***************************@mb-m21.aol.com>, seen in
news:comp.lang.javascript, HikksNotAtHome <hi************@aol.com>
posted at Sun, 17 Aug 2003 17:55:11 :-
This is a very simplified example of an Intranet application. But, is there an
easier (or more efficient) way of getting the decimal equivalent of a fraction?

The actual function gets the select values, this one is a simplified version
where its passed.

function checkIt(selVal){
valueInDec1 = eval(selVal);
//do some calculations here with valueInDec1
}

<select onchange="checkIt(this.value)">
<option value="0">0</option>
<option value="1/16">1/16</option>
<option value="1/8">1/8</option>
..............
<option value="7/8">7/8</option>
<option value="15/16">15/16</option>
</select>

Don't be afraid of eval. In this case you need to evaluate a string
chosen at run time, for which eval is appropriate. Pre-conversion of
value to a numeric literal form gives long numbers or inaccuracy, if the
denominator is not a power of two.

Speed does NOT matter, since the evaluation only occurs after a manual
operation. Here, efficiency is code shortness.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links;
some Astro stuff via astro.htm, gravity0.htm; quotes.htm; pascal.htm; &c, &c.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 20 '05 #8
In article <20***************************@mb-m02.aol.com>,
hi************@aol.com (HikksNotAtHome) writes:
But I wasn't avoiding eval for the sake of avoiding it. When I first tried
it, I actually expected it to be slower, and got to looking at it, and thinkingabout what it was actually doing, and then started testing it. Saw where eval
was faster, so I wanted other opinions on it. There may even be a flaw in my
test itself?


Many thanks to everyone who replied.

For now, I am going to go ahead and use the split/divide approach, not because
of speed (I dont see how it can make *any* perceptible difference to the user,
not when you start talking in the decimal range of ms to execute it once,
either way), for no other reason than my own sanity with regards to eval. I
have spent the better part of 6 months fighting the use of eval. It took me 2
months to show them that I could get at any form element, no matter how
bastardized they made it, without eval, so instead of going back and saying
"Hey, in IE, eval actually does it faster", I will just use the split/divide
method. Then, if its ever converted (the intranet), to a non-IE environment, I
will have the fastest of the 2 already in place.

Again, thanks to all. Now, I can get to hacking/whacking at Jims crypto page.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #9
HikksNotAtHome wrote:
In article <20***************************@mb-m02.aol.com>,
hi************@aol.com (HikksNotAtHome) writes:
But I wasn't avoiding eval for the sake of avoiding it. When I first tried
it, I actually expected it to be slower, and got to looking at it, and

thinking
about what it was actually doing, and then started testing it. Saw where eval
was faster, so I wanted other opinions on it. There may even be a flaw in my
test itself?


Many thanks to everyone who replied.

For now, I am going to go ahead and use the split/divide approach, not because
of speed (I dont see how it can make *any* perceptible difference to the user,
not when you start talking in the decimal range of ms to execute it once,
either way), for no other reason than my own sanity with regards to eval. I
have spent the better part of 6 months fighting the use of eval. It took me 2
months to show them that I could get at any form element, no matter how
bastardized they made it, without eval, so instead of going back and saying
"Hey, in IE, eval actually does it faster", I will just use the split/divide
method. Then, if its ever converted (the intranet), to a non-IE environment, I
will have the fastest of the 2 already in place.

Again, thanks to all. Now, I can get to hacking/whacking at Jims crypto page.
--
Randy


May I also suggest that instead of:

<select onchange="func(this.value);">

you use:

<select onchange="func(this.options[this.selectedIndex].value);">
:)

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #10

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

Similar topics

8
by: neblackcat | last post by:
Would anyone like to comment on the following idea? I was just going to offer it as a new PEP until it was suggested that I post it here for comment & consideration against PEP 308. I'm far...
3
by: McKirahan | last post by:
I said I wouldn't use "eval()" anymore but I need help to do it. Below is some stripped-down code (4 lines; watch for word-wrap) extracted from USGA.COM that preloads images: main_nav_home_F1...
7
by: Reply Via Newsgroup | last post by:
This might sound sad... someone requesting a disertation on the 'eval' statement... but... I've been reading someone else's post - they had a huge calander like script and a handful of folk cursed...
24
by: Wim Roffal | last post by:
Is there a possibility to do a string replace in javascript without regular experessions. It feels like using a hammer to crash an egg. Wim
7
by: steveneill | last post by:
Is this an alternative to eval(). Admittidly, I have done *very* little testing (ran it a few times in Firefox), but it seemed to work suprisingly well with simple expressions such as...
3
by: BUX | last post by:
I have to get public variable value using variable name. Evals("myPublicVariable") do nor work How can I do? thank you
3
by: Vik Rubenfeld | last post by:
I'm working on integrating the a javascript wysiwyg editor (Xinha) with my blog software (ExpressionEngine, aka EE). EE has extensions now so it's easy to get the Xinha header code into the head...
7
by: Cramer | last post by:
In addition to Web.config, I have a few configuration values that I store in a sql server database. I would like to read them from the database only once per Application.Start (there is no need to...
4
by: spamme | last post by:
Hi, As you can see from the following code, I am trying to manipulate a large number of layers. I have read many times in the past how the "Eval" function should be used very sparingly as it can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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,...
0
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...
0
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,...
0
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...
0
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,...

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.