|
The previous post contains some logic errors. Just keep in mind that javascript utilizes zero based arrays. I know I didn't. -----Original Message----- From: Stone, Brad V (TC) [SMTP:bvstone@taylorcorp.com] Sent: Monday, January 29, 2001 3:04 PM To: 'MIDRANGE-L@midrange.com' Subject: RE: Net.Data and javascript Yep, that's what I meant. Thanks for expressing it better than I. I don't use Net.Data that often so I wasn't sure of the exact syntax. :) As for performance, Javascript tends to be quite speedy because it's client side and takes the processing power off the server. Every time I write a "fairly complex" javascript routine and expect it to perform terribly, I am surprised to see that it runs VERY fast (no noticable lag). Brad > -----Original Message----- > From: MEovino@ESTES-EXPRESS.COM [mailto:MEovino@ESTES-EXPRESS.COM] > Sent: Monday, January 29, 2001 1:44 PM > To: MIDRANGE-L@midrange.com > Subject: RE: Net.Data and javascript > > > > Brad, > > Couldn't he use a WHILE block to roll through the table and > generate the > JavaScript? Something like: > > %WHILE (loopCounter <= $(rws)) > @DTW_TB_GETV(texttable,loopCounter,"1",variable) > textarr[$(loopCounter)] = $(variable); > @DTW_ADD(loopCounter,"1",loopCounter) > %} > > Or maybe that's exactly what you meant. > > If the table's created by an SQL function, you could also > probably do it in > a ROW block. I don't know which performs better. > > Mike Eovino > E-commerce and Customer Development Manager > Estes Express Lines > http://www.estes-express.com > > The views, opinions, and judgments expressed in this message > are solely > those of the author. The message contents have not been reviewed or > approved by Estes Express Lines > > This communication is confidential and is intended to be > privileged. If > there is a problem with this transmission, please contact the > sender. If > the reader of this message is not the intended recipient, or > the employee > or agent responsible to deliver it to the intended recipient, you are > hereby notified that any dissemination, distribution or > copying of this > communication is strictly prohibited. > > > > > > > > >>Not sure this will work. It looks like you're trying to > mix client side > >>(JavaScript) and server site (Net.Data). > > >>You will most likely have to fill the array in one by one.. > > >>field[1]="data1"; > >>field[2]="data2"; > .... > > >>This should be doable with Net.Data and the Rows functions. > But mixint > >>Net.Data calls inside of Javascript won't work. > > >>Brad > > > -----Original Message----- > > From: Mark Walter [mailto:mwalter@netrax.net] > > Sent: Monday, January 29, 2001 12:41 PM > > To: List Midrange (E-mail) > > Subject: Net.Data and javascript > > > > > > Here's one for you Net.Data gurus, > > > > I'm trying to load the contents of a Net.Data Table into a > javascript > > array. If I run the script, I am using a net.data variable > > derived from the > > DTW_TB_ROWS function to control the Javascript loop, If I > > view the source, > > I can see the variables value in the FOR statement. I am using the > > DTW_TB_GETV function to retrieve the value of the row. Again > > if I view the > > source, I am seeing the value of the first row in the > > assignment statement, > > however it looks like there is only one iteration. > > > > Here is the output of the Net.Data Macro: > > > > %html(testjscr) { > > @qrytext(texttable) > > @DTW_TB_ROWS(texttable,rws) > > > > <html> > > <head><title>Text Test</title><head> > > <body> > > <h1> Here is your Scrolling Text.</h1> > > <center> > > > > <script language="javascript"> > > textarr = new array() > > var i = 0 > > for(i=1;i==$(rws);i++) { <---- The value of $(rws) > > is = to the > > number of rows in the table > > @DTW_TB_GETV(texttable,x,"1",variable) > > @DTW_ADD(x,"1",x); > > textarr[i] = $(variable); <--- The value of > > $(variable) is = to > > the text in the first row. > > } > > > > for(i=1;i==$(rws);i++) > > document.write(textarr[i] + "<br>"); > > </script> > > > > </center> > > </body> > > </html> > > %} > > > > This is the Generated HTML Source: > > > > <html> > > <head><title>Text Test</title><head> > > <body> > > <h1> Here is your Scrolling Text.</h1> > > <center> > > > > <script language="javascript"> > > textarr = new array() > > var i = 0 > > for(i=1;i==3;i++) > > ; > > ; > > textarr[i] = THIS IS TEXT RECORD 1; > > > > for(i=1;i==3;i++) > > document.write(textarr[i] + "<br>"); > > > > </script> > > > > </center> > > </body> > > </html> > > > > +--- > > | This is the Midrange System Mailing List! > > | To submit a new message, send your mail to > MIDRANGE-L@midrange.com. > > | To subscribe to this list send email to > MIDRANGE-L-SUB@midrange.com. > > | To unsubscribe from this list send email to > > MIDRANGE-L-UNSUB@midrange.com. > > | Questions should be directed to the list owner/operator: > > david@midrange.com > > +--- > > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to > MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +--- > > > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to > MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +--- > +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.