473,387 Members | 3,781 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,387 software developers and data experts.

Why am I getting Javascript (form) or (this.form) errors?


In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp
--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 24 '07 #1
32 1965
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:
>
In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.
Mar 24 '07 #2
MassiveProng wrote:
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:

>>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.
JavaScript 1.1 being developed with Adobe GoLive 5.0.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 24 '07 #3
On Mar 24, 10:05 am, MassiveProng
<MassivePr...@thebarattheendoftheuniverse.orgwrote :
<input type="button" value="Improve?" onclick="imProveX
(this.form)">
function imProveX (form) { setAmplitude (this.form) ;
here this refers to the imProveX function and there is no form
property for function. pass the argument to setAmplitude function and
all should be fine.

function imProveX (form) { setAmplitude (form) ;
Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.
??????????????

Mar 24 '07 #4

"Don Lancaster" <do*@tinaja.comwrote in message
news:56*************@mid.individual.net...
>
In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s value
and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Try:

function imProveX (form) { setAmplitude (form) ; }
Mar 24 '07 #5
On Sat, 24 Mar 2007 09:10:34 -0700, Don Lancaster <do*@tinaja.com>
Gave us:
>MassiveProng wrote:
>On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:

>>>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.

JavaScript 1.1 being developed with Adobe GoLive 5.0.

Could also relate to the runtime engine you are trying to run it
under.
Mar 24 '07 #6
Don Lancaster wrote:
>>In an existing, tested and working program,
I have a form entry that simplifies to...
<INPUT name ="fp1s" type="text" value=0.000 size=12 >
. . .
MassiveProng wrote:
Depends on what version of java you have,
and what you are developing scripts under,
and their co-compatibilities.
One of you two has no idea what he is talking about.
"javascript:
The World's Most Misunderstood Programming Language"
by Douglas Crockford
http://66.102.9.104/search?q=cache:g...ggy-*-browsers

Mar 24 '07 #7
ASM
Don Lancaster a écrit :
>
<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;
function imProveX(form) { setAmplitude( form ); }
this.form is already here ------^
and was called in button

To avoid mistakes try to do not use variables named as elements

function imProveX ( something ) { setAmplitude( something ); }
or
function imProveX ( aForm ) { setAmplitude( aForm ); }
This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object
it would have to be : 'form.p1s' is null or not an object

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 24 '07 #8
MassiveProng said the following on 3/24/2007 12:05 PM:
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:
<snip>
>An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
The this above refers to the function and as such has no property named
"form". If you want to pass it, simply pass the parameter form.
> } ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp


Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.
Has nothing to do with any of that.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 24 '07 #9
MassiveProng said the following on 3/24/2007 12:34 PM:

<snip>
Could also relate to the runtime engine you are trying to run it
under.
No, it relates to scope issues of variables and has nothing to do with
any "runtime engine"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 24 '07 #10
On Sat, 24 Mar 2007 14:11:38 -0400, Randy Webb wrote:
MassiveProng said the following on 3/24/2007 12:05 PM:
>On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
<snip>
>>An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;

The this above refers to the function and as such has no property named
"form". If you want to pass it, simply pass the parameter form.
>>This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.

Has nothing to do with any of that.
I see MicroBrain is metastasizing. =:-O

Cheers!
Rich
Mar 24 '07 #11
On Sat, 24 Mar 2007 14:12:41 -0400, Randy Webb
<Hi************@aol.comGave us:
>MassiveProng said the following on 3/24/2007 12:34 PM:

<snip>
> Could also relate to the runtime engine you are trying to run it
under.

No, it relates to scope issues of variables and has nothing to do with
any "runtime engine"

We had problems at work after upgrading to a new version. Just
thought I'd mention it. No big deal.
Mar 24 '07 #12
On Sat, 24 Mar 2007 21:25:44 GMT, Rich Grise <ri**@example.netGave
us:
>On Sat, 24 Mar 2007 14:11:38 -0400, Randy Webb wrote:
>MassiveProng said the following on 3/24/2007 12:05 PM:
>>On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
<snip>
>>>An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;

The this above refers to the function and as such has no property named
"form". If you want to pass it, simply pass the parameter form.
>>>This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.

Has nothing to do with any of that.

I see MicroBrain is metastasizing. =:-O

You're an idiot, GriseTard. What now... a stalking idiot as well?

Mar 24 '07 #13
Don Lancaster wrote:
MassiveProng wrote:
>On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:

>>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except
from within a new proc instead of a button click. Instaad, an error
of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp


Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.


JavaScript 1.1 being developed with Adobe GoLive 5.0.
There is a JavaScript NG and the posters there are *extremely* helpful.
Mar 24 '07 #14
On Mar 25, 2:13 am, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
On Mar 24, 10:05 am, MassiveProng

<MassivePr...@thebarattheendoftheuniverse.orgwrote :
<input type="button" value="Improve?" onclick="imProveX
(this.form)">
function imProveX (form) { setAmplitude (this.form) ;

here this refers to the imProveX function
No, it references the global object.

The only way imProveX's this keyword can refer to the imProveX
function is if the calling function had set it that way using call or
apply methods, and it doesn't. imProvex is called as a method of
window, effectively as window.imProvex(). Therefore its this keyword
references the window (global) object.

and there is no form
property for function.
for the global object (unless one has been created elsewhere).

pass the argument to setAmplitude function and
all should be fine.

function imProveX (form) { setAmplitude (form) ;
That should do it.
--
Rob

Mar 25 '07 #15
On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:
function imProveX (form) { setAmplitude (this.form) ;
here this refers to the imProveX function

No, it references the global object.
Thanks for the info.

btw, randy said the same thing :)

function imProveX (form) { setAmplitude (form) ;

That should do it.
Yup.. if you add the missing brace.

Mar 25 '07 #16
Don Lancaster wrote:
>
In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function (form) { setAmplitude (this.form) ;
} ;
Inside this function, 'this.form' is undefined. I think you need to pass
'form' to setAmplitude.
This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.
Because its null (not defined in the calling function imProveX.
What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
--
Paul Hovnanian mailto:Pa**@Hovnanian.com
------------------------------------------------------------------
The ark was skippered by amateurs, the Titanic was skippered by
professionals.
Mar 25 '07 #17
scripts.contact wrote:
On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:
>>>> function imProveX (form) { setAmplitude (this.form) ;
>>>here this refers to the imProveX function

No, it references the global object.


Thanks for the info.

btw, randy said the same thing :)
>>>function imProveX (form) { setAmplitude (form) ;

That should do it.


Yup.. if you add the missing brace.
Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp
--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 25 '07 #18
Don Lancaster wrote:
>
MassiveProng wrote:
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com>
Gave us:

>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmplitude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve?" onclick="imProveX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp


Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.

JavaScript 1.1 being developed with Adobe GoLive 5.0.

"Classic Wrong" doesn't know the difference between "Java"" and
"Javascript". :(
--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
Mar 25 '07 #19
Rich Grise said the following on 3/24/2007 5:25 PM:
On Sat, 24 Mar 2007 14:11:38 -0400, Randy Webb wrote:
>MassiveProng said the following on 3/24/2007 12:05 PM:
<snip>
>Has nothing to do with any of that.

I see MicroBrain is metastasizing. =:-O
I see c.l.j isn't the only group with an idiot. Are you related to VK by
chance? Genetics might explain it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 25 '07 #20
Don Lancaster wrote:
scripts.contact wrote:
>On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:
>>>>> function imProveX (form) { setAmplitude (this.form) ;
here this refers to the imProveX function
No, it references the global object.

Thanks for the info.

btw, randy said the same thing :)
>>>function imProveX (form) { setAmplitude (form) ;
That should do it.

Yup.. if you add the missing brace.

Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp

Find a way to make a crude guess that is not too far off and use
binary search (but i assume you already knew that.
If the crude guess is fairly close, maybe use Taylors series on
(1+error)?
Mar 25 '07 #21
Don Lancaster said the following on 3/25/2007 12:21 AM:

<snip>
Presently exploring how to get this code to converge faster.
If by converging you mean execution speed, I didn't play very much but I
was getting pretty instant results from the button clicks. You could
remove some of the eval calls (I think there were 88 of them) where a
lot of them appear to simply be eval'ing a string to convert it to a
number. You could also look into some of the functions where you are
referencing document.formName.elementName.value repeatedly with multiple
elements. By storing a reference to document.formName you could speed up
the look up time. In the reportToForm function you have lines like this:

document.mainform.fh07.value = fixFloat (h07, numPoints) ;

If, at the beginning of reportToForm you had a statement like this:

theForm = document.mainform;

Then you could change your references to this:

theForm.fh07.value

Which would pick up some speed gains.

After that, there are some other things I noticed in functions like
hiHarm it appears you are doing some calculations and then calling
another function. Are the p## variables changing each time you are
calling that function? If not, move them outside the function and you
don't have to repeatedly calculate them.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 25 '07 #22
On Sun, 25 Mar 2007 05:58:02 GMT, "Michael A. Terrell"
<mi**********@earthlink.netGave us:
"Classic Wrong" doesn't know the difference between "Java"" and
"Javascript". :(

Fuck you, asswipe.
Mar 25 '07 #23
Robert Baer wrote:
Don Lancaster wrote:
>scripts.contact wrote:
>>On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:

>> function imProveX (form) { setAmplitude (this.form) ;

here this refers to the imProveX function

No, it references the global object.


Thanks for the info.

btw, randy said the same thing :)

function imProveX (form) { setAmplitude (form) ;

That should do it.


Yup.. if you add the missing brace.

Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp

Find a way to make a crude guess that is not too far off and use
binary search (but i assume you already knew that.
If the crude guess is fairly close, maybe use Taylors series on
(1+error)?
Been there, done that.

The series polynomials are very high order.
--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 25 '07 #24
Randy Webb wrote:
Don Lancaster said the following on 3/25/2007 12:21 AM:

<snip>
>Presently exploring how to get this code to converge faster.


If by converging you mean execution speed, I didn't play very much but I
was getting pretty instant results from the button clicks. You could
remove some of the eval calls (I think there were 88 of them) where a
lot of them appear to simply be eval'ing a string to convert it to a
number. You could also look into some of the functions where you are
referencing document.formName.elementName.value repeatedly with multiple
elements. By storing a reference to document.formName you could speed up
the look up time. In the reportToForm function you have lines like this:

document.mainform.fh07.value = fixFloat (h07, numPoints) ;

If, at the beginning of reportToForm you had a statement like this:

theForm = document.mainform;

Then you could change your references to this:

theForm.fh07.value

Which would pick up some speed gains.

After that, there are some other things I noticed in functions like
hiHarm it appears you are doing some calculations and then calling
another function. Are the p## variables changing each time you are
calling that function? If not, move them outside the function and you
don't have to repeatedly calculate them.

No, the JavaScript execution speed is not the immediate goal.
But thanks for the tips.

The present goal is to find a fully deterministic solution to magic
sinewave angles in a single step, rather than needing as many as five
repeat (but remarkably fast converging) iterations.

Using JavaScript exploration to find (or prove not) an underlying algorithm.

Until recently, there was no reason to even suspect a deterministic
solution equal to Magic Sinewave angles and Newton's method existed at
all. 14x14 equations of multiple angle trig polynomials to the 28th
power would not appear to offer trivial solutions. Chebycheff
notwithstanding.

At present, Newton's Method works so extremely well that it strongly
suggests a determnistic solution can be found. Finding one greatly
simplifies extension to other numbers of pulses per quadrant.

And is the "missing link" to a totally solid Magic Sinewave theory.

Speed can come later. Speed is not an issue when zeroing out a few dozen
low harmonics. Eventually the system can zero THOUSANDS of harmonics
leading to a stunningly efficient means of digital sinewave generation.

Calculation time currently goes up with the third or fourth power of the
number of harmonics zeroed.

See http://www.tinaja.com/glib/msinexec.pdf for a tutorial and the
underlying equation set to be solved.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 25 '07 #25
In comp.lang.javascript message <f0ja03d5kr35qjqll27vev1a84pponfdi4@4ax.
com>, Sat, 24 Mar 2007 09:05:21, MassiveProng <MassiveProng@thebaratthee
ndoftheuniverse.orgposted:
>
Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities.
Feel free to contribute here in news:comp.lang.javascript, if you ever
have anything useful to say; but not otherwise.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Mar 25 '07 #26
Don Lancaster wrote:
>
scripts.contact wrote:
On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:
>>> function imProveX (form) { setAmplitude (this.form) ;

here this refers to the imProveX function

No, it references the global object.

Thanks for the info.

btw, randy said the same thing :)
>>function imProveX (form) { setAmplitude (form) ;

That should do it.

Yup.. if you add the missing brace.


Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp
I don't see any code there (a few busted links). What sort of algorithm
is it that you are trying to converge?
--
Paul Hovnanian mailto:Pa**@Hovnanian.com
------------------------------------------------------------------
It is not enough to succeed. Others must fail. -- Gore Vidal
Mar 25 '07 #27
Paul Hovnanian P.E. wrote:
Don Lancaster wrote:
>>scripts.contact wrote:
>>>On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:
>> function imProveX (form) { setAmplitude (this.form) ;

>here this refers to the imProveX function

No, it references the global object.
Thanks for the info.

btw, randy said the same thing :)


>function imProveX (form) { setAmplitude (form) ;

That should do it.
Yup.. if you add the missing brace.

Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp


I don't see any code there (a few busted links). What sort of algorithm
is it that you are trying to converge?


See http://www.tinaja.com/glib/msinexec.pdf for a tutorial and the
underlying 14 x 14 equation set to be deterministically solved.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 25 '07 #28
On Sun, 25 Mar 2007 19:34:46 +0100, Dr J R Stockton
<jr*@merlyn.demon.co.ukGave us:
>
Feel free to contribute here in news:comp.lang.javascript, if you ever
have anything useful to say; but not otherwise.
Whatever. We run a huge Oracle system at work, and it has issues
with the most recent java upgrade.

It was the first thing that came to mind. Like I said, it was no
big deal to have suggested it.
Mar 25 '07 #29
In comp.lang.javascript message <56*************@mid.individual.net>,
Sat, 24 Mar 2007 21:21:52, Don Lancaster <do*@tinaja.composted:
>
Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?
It seems almost instant now.

Check that you are taking full advantage of symmetry, and not
calculating anything more than once - but I expect you did that. Don't
recalculate pi/180 or 180/pi - in fact, work entirely in radians and
cycles, except for I/O, of which there is little.

Minimise object lookups - e.g.
document.mainform.fp1e.value = p1ed ;
document.mainform.fp2s.value = p2sd ;
...
becomes
dmf = document.mainform // done only once

dmf.fp1e.value = p1ed ;
dmf.fp2s.value = p2sd ;
...

For me, setting Q = Math.sin globally and using Q(0.1) instead of
Math.sin(0.1) makes a small improvement.

p1e = eval (document.mainform.fp1e.value) // why eval? use
p1e = +document.mainform.fp1e.value // see FAQ

Many, at least, of your eval calls are obviously not inner-loop; but I
doubt whether any are needed.
I agree with what other CLJ users wrote - for a better S/N, post only
there (FU set).

I did not have time to determine your iteration algorithm, and that's
where the greatest gains must lie.

>Latest working version is http://www.tinaja.com/demo28a.asp
It appears, from that page, that it deals with something related to work
I used to do - but perhaps you already know that. The page desperately
needs a SMALL box near the top saying what a Magic Sinewave is (mainly
for those who know the subject but not the term) with a link to
<http://www.tinaja.com/glib/msinexec.pdf>.

I tried your code on my automatic re-indenter, but it seemed to be
taking infinite time on that amount.

Once upon a time, I made a 16 2/3 Hz PSD (mains-locked) by switching
(with reeds!) positive for one cycle of 50 Hz, off for half a cycle,
negative for one cycle, off for half a cycle, repeated. Earlier, I
built a three-phase oscillator with (IIRC) three OC71 transistors and 6
resistors - it generated 200 kHz trapezium waves, more or less.

--
(c) John Stockton, Surrey, UK. *@merlyn.demon.co.uk / ??*********@physics.org
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Correct <= 4-line sig. separator as above, a line precisely "-- " (SoRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SoRFC1036)
Mar 25 '07 #30
Don Lancaster wrote:
Robert Baer wrote:
>Don Lancaster wrote:
>>scripts.contact wrote:

On Mar 24, 6:58 pm, "RobG" <r...@iinet.net.auwrote:

>>> function imProveX (form) { setAmplitude (this.form) ;
>
>
>
>here this refers to the imProveX function
>
>
>
No, it references the global object.


Thanks for the info.

btw, randy said the same thing :)

>function imProveX (form) { setAmplitude (form) ;
>
>
>
That should do it.


Yup.. if you add the missing brace.


Many thanks to everyone. Using (form) rather than (this.form) did it.

Presently exploring how to get this code to converge faster.
Preferably instantly.
Any suggestions?

Latest working version is http://www.tinaja.com/demo28a.asp

Find a way to make a crude guess that is not too far off and use
binary search (but i assume you already knew that.
If the crude guess is fairly close, maybe use Taylors series on
(1+error)?

Been there, done that.

The series polynomials are very high order.

Then maybe you want to use russian peasant method for your power series.
--
JosephKK
Gegen dummheit kampfen die Gotter Selbst, vergebens.Â*Â*
--Schiller
Mar 26 '07 #31
In comp.lang.javascript message <sW**************@invalid.uk.co.demon.me
rlyn.invalid>, Sun, 25 Mar 2007 22:13:35, Dr J R Stockton
<jr*@merlyn.demon.co.ukposted:
>
I did not have time to determine your iteration algorithm, and that's
where the greatest gains must lie.
I've looked again.

Basically, you have around a dozen parameters marking the positions of
the transitions, and you want to adjust those for the best result; you
can calculate the goodness of the result, and want to maximise it.

That's a standard problem, and code for it has been around for almost as
long as there has been code.

In particular, if you can differentiate the goodness with respect to
each of the parameters, coding those functions, there is a method giving
rapid convergence; I used it long ago. NAG, http://www.nag.co.uk/,
should have it. But you need a professional to locate the right routine
for your case.

Have you read through Knuth?

You give your address as in AZ in the cited PDF - does Azerbaijan have
any good universities?

--
(c) John Stockton, Surrey, UK. *@merlyn.demon.co.uk / ??*********@physics.org
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Correct <= 4-line sig. separator as above, a line precisely "-- " (SoRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SoRFC1036)
Mar 26 '07 #32
"JeffM" <je****@email.comwrote in message
news:11*********************@l75g2000hse.googlegro ups.com...
One of you two has no idea what he is talking about.
"javascript:
The World's Most Misunderstood Programming Language"
by Douglas Crockford
http://66.102.9.104/search?q=cache:g...ggy-*-browsers
Was it really *that* hard to paste:

http://javascript.crockford.com/javascript.html

....?

-Lost
Mar 27 '07 #33

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

Similar topics

0
by: Ronan | last post by:
Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL database then execute a javascript function. ...
6
by: Charles Banas | last post by:
weird subject - i hope more than just one curious regular will hear me out. :) ok, i've got a bit of a big problem, and i need answers as soon as possible. i know this forum is meant for web...
12
by: Tom | last post by:
Hi all, I am a newbe to javascript so I could use your help. I checked the FAQs and searched google but I could not resolve this problem. My form is as follows: <form...
2
by: Kenneth | last post by:
Is there anyway to create a javascript function to submit a form in the same html file?
5
by: ojvm | last post by:
ok. thanks again for the time spend reading this. this code adds 2 controls in html form but it places in top of the form. i want this control1 control2 control1 control2 control1 ...
10
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> ...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
1
by: news.wanadoo.nl | last post by:
Hi, I have found whit google this form in this group. But i'n not good in javascript :(. I try and error normal but i only error now :P Whit i now want to now how can i get access to the vars...
4
by: ashore | last post by:
Folks, the snippet below errors out on both FF and IE, with FF's error console complaining "this.form has no properties", while a reference to "document.forms.name" works correctly. <form...
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: 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...
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: 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...

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.