Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22383

Re: Javascript Help Needed

From Jim Rojas <jrojas@tech-man.com>
Newsgroups comp.lang.javascript
Subject Re: Javascript Help Needed
References <6h5uu.25363$gh2.7307@fx24.iad> <XnsA2A05E790CBE2eejj99@194.109.133.133> <Pkhuu.63688$ad.14790@fx04.iad> <XnsA2A0B90F3892Beejj99@194.109.133.133>
Message-ID <arjuu.57225$Qi4.22852@fx11.iad> (permalink)
Organization TeraNews.com
Date 2013-12-24 12:24 -0500

Show all headers | View raw


Evertjan. wrote:
> Jim Rojas <jrojas@tech-man.com> wrote on 24 dec 2013 in
> comp.lang.javascript:
>
>> Evertjan. wrote:
>>> Jim Rojas <jrojas@tech-man.com> wrote on 24 dec 2013 in
>>> comp.lang.javascript:
>>>
>>>> Hi. I have a javascript that needs to be modified
>>>
>>> This NG is not about scripting Java,
>>> so perhaps you mean "a Javascript script"?
>
> Answer?
>
>>>> to provide some basic
>>>> shipping calculations I need for my website.
>>>
>>>> The script basically takes an array, and then displays it on a
>>>> webpage. At this point, there is only one table array. I need it to
>>>> display 3 at the same time.
>>>
>>> As you perhaps not know, we discuss Javascript scripting here,
>>> we don't provide scripts on demand [well, you could meet some
>>> overzealous bloke here in a particular xmas mood], so perhaps you can
>>> give a short example of what you have done sofar, excluding any
>>> scripting not part of your problem, and specificly show us why you
>>> cannot make a function applicable to three seperate tables getting data
>>> from three seperate arrays:
>>>
>>> function fillTable( table-id, table-array ) { ... };
>>>
>>>
>>>> I understand how to manipulate the data, it is the javascript itself I
>>>> am having trouble with.
>>>
>>> I don't see how those two are seperable, Jim.
>>> Surely the thing you do is manipulating the data with Javascript?
>
> Could you respond to this, Jim, this surely is about data-manipulation?
>
>>>
>>>> I also want to be able to break up the code so the array tables are in
>>>> an include file for easy future modifications.
>
>>> There is no need to break up the Javascript code for that,
>>> you better copy your code into your next endavour,
>>> as otherwize you would have to test all your older pages for errors
>>> following your "improvements".
>>>
>>>> ... want to be able ...
>>>
>>> But really, is this just a statement or a Q?
>>>
>>
>> The code right now works fine. It calculates just one shipping rate. I
>> want to be able to calculate 3 rates at the same time.
>
> Supposing this is a question to us, that would be possible by just writing a
> script that accomodates that. [Well not exactly "at the same time", a as
> javascript engines in browsers are not multithreaded.]
>
> I suppose you mean you want YOUR CODE to be able to calculate that?
> So you should be able to write the code for that.
>
>> USPS postage rate for FCPIS, PMI & PMEI. I have the script working on a
>> test page. You will see the output display the way I need it to. I just
>> don't understand how to add the other 2 tables to the script.
>>
>> http://www.inshipsoultions.com/uspstest.html
>
> You added:
> ~ Sorry
> ~ http://www.inshipsolutions.com/uspstest.html
>
>> The complete sourcecode is in the html.
>
> That's why I asked tou to write a SHORT simple example, I don't want to go
> through this large amount of code, neither will I write functional code for
> you.
>
> I can only emhasize you could write a function that is fed by the parameters
> you give, and returns results depending on those parameters in the requested
> html-table as per your wish:
>
>   function fillTable( table-id, data-array ) {
>      [code you should write here];
>   };
>
> and then do:
>
>    fillTable( table-id-1, data-array-1 );
>    fillTable( table-id-2, data-array-2 );
>    fillTable( table-id-3, data-array-3 );
>
> Could you start with that?
>
> In the testing/debugging fase that must follow your scripting strive,
> is would be best for you to reduce the enormous arrays to arrays of one or
> two lines, perhaps even in one or more seperate script files, [or as
> suggested by others in a csv file.] So after testing that those arrays are
> coherent in code, you could concentrate at the functional code at hand.
>
> =================== test.html =============================
>
> <script src='my-arrays.js'></script>
> <script>
>
>   function fillTable( a-table-id, a-data-array ) {
>      [code you should write here];
>   };
>
> function filltables(){
>   fillTable( table-id-1, data-array-1 );
>   fillTable( table-id-2, data-array-2 );
>   fillTable( table-id-3, data-array-3 );
> };
>
> body.onload = filltables;
>
> </script>
> <table id='table-id-1'> ... </table>
> <table id='table-id-2'> ... </table>
> <table id='table-id-3'> ... </table>
>
> ===================================================
>
>> --
>> This email is free from viruses and malware because avast! Antivirus
>> protection is active. http://www.avast.com
>
> What nonsense, this posting of yours is NOT AN EMAIL AT ALL!
> As this NG is text-only, there is no reason to expect a virus to run anyway.
>


I do not know how to write script. But your explanation will give me 
something I can work with. I understand html, so I am not totally lost here.

I will let you know my progress.

Thank you

Jim Rojas


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-23 20:17 -0500
  Re: Javascript Help Needed "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-24 09:17 +0100
    Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-24 10:01 -0500
      Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-24 10:02 -0500
      Re: Javascript Help Needed "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-24 18:11 +0100
        Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-24 12:24 -0500
          Re: Javascript Help Needed "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-12-24 19:03 +0100
          Re: Javascript Help Needed Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-24 19:18 +0000
    Re: Javascript Help Needed Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-12-25 23:06 +0000
  Re: Javascript Help Needed Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-24 19:52 +0000
    Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-24 15:02 -0500
      Re: Javascript Help Needed Christoph Michael Becker <cmbecker69@arcor.de> - 2013-12-24 22:07 +0100
      Re: Javascript Help Needed Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-25 02:16 +0000
        Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-24 21:48 -0500
      Re: Javascript Help Needed Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-12-25 23:05 +0000
    Re: Javascript Help Needed Christoph Michael Becker <cmbecker69@arcor.de> - 2013-12-24 22:09 +0100
      Re: Javascript Help Needed Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-25 01:51 +0000
      Re: Javascript Help Needed Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-26 07:38 +0100
        Re: Javascript Help Needed Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-26 10:42 +0100
          Re: Javascript Help Needed Jim Rojas <jrojas@tech-man.com> - 2013-12-26 13:14 -0500
        Re: Javascript Help Needed Christoph Michael Becker <cmbecker69@arcor.de> - 2013-12-27 22:49 +0100
          Re: Javascript Help Needed Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-27 23:25 +0100

csiph-web