Eval(array)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • e271828

    Eval(array)

    I am trying to develop a rudimentary graphing program which uses the
    eval() function to execute some innerHTML and getElementById. I can
    reflect strings so that you can type something into a field and have it
    immediately reflected, but have no such luck with splitting that string
    into an array dynamically and having that reflected.

    I'd like to have it take the string typed into a text field, split that
    along commas in the string into an array, then pass that array as a
    variable to a parameter in another function. I can declare the data
    (heights of a bar graph) by hard-writing it into the code, which works
    fine, but have yet to have any luck on making it respond to client-side
    input. It seems like this could be done. I'd greatly appreciate any
    advice from those more experienced JS.

  • Aaron Gray

    #2
    Re: Eval(array)

    "e271828" <emw2012@gmail. com> wrote in message
    news:1150343188 .497641.206430@ g10g2000cwb.goo glegroups.com.. .[color=blue]
    >I am trying to develop a rudimentary graphing program which uses the
    > eval() function to execute some innerHTML and getElementById. I can
    > reflect strings so that you can type something into a field and have it
    > immediately reflected, but have no such luck with splitting that string
    > into an array dynamically and having that reflected.
    >
    > I'd like to have it take the string typed into a text field, split that
    > along commas in the string into an array, then pass that array as a
    > variable to a parameter in another function. I can declare the data
    > (heights of a bar graph) by hard-writing it into the code, which works
    > fine, but have yet to have any luck on making it respond to client-side
    > input. It seems like this could be done. I'd greatly appreciate any
    > advice from those more experienced JS.[/color]

    Sounds like you need a basic JS tutorial.

    You may also be interested in Walter Zorn's JS Graphics routines :-

    Slot88 resmi persembahan rrq88 slot merupakan situs link slot gacor hari ini dengan rtp live tertinggi setiap hari.


    Aaron


    Comment

    • Dr John Stockton

      #3
      Re: Eval(array)

      JRS: In article <1150343188.497 641.206430@g10g 2000cwb.googleg roups.com>
      , dated Wed, 14 Jun 2006 20:46:28 remote, seen in
      news:comp.lang. javascript, e271828 <emw2012@gmail. com> posted :
      [color=blue]
      >I am trying to develop a rudimentary graphing program which uses the
      >eval() function to execute some innerHTML and getElementById. I can
      >reflect strings so that you can type something into a field and have it
      >immediately reflected, but have no such luck with splitting that string
      >into an array dynamically and having that reflected.[/color]

      I don't really follow your terminology; an example of the data might
      help.
      [color=blue]
      >I'd like to have it take the string typed into a text field, split that
      >along commas in the string into an array, then pass that array as a
      >variable to a parameter in another function. I can declare the data
      >(heights of a bar graph) by hard-writing it into the code, which works
      >fine, but have yet to have any luck on making it respond to client-side
      >input. It seems like this could be done. I'd greatly appreciate any
      >advice from those more experienced JS.[/color]

      There's a basic Bar Chart demo at
      <URL:http://www.merlyn.demo n.co.uk/js-misc1.htm#BC>;
      but it does not use eval.

      --
      © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
      <URL:http://www.jibbering.c om/faq/>? JL/RC: FAQ of news:comp.lang. javascript
      <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
      <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: Eval(array)

        "e271828" <emw2012@gmail. com> writes:
        [color=blue]
        > I am trying to develop a rudimentary graphing program which uses the
        > eval() function to execute some innerHTML and getElementById.[/color]

        Sounds, unnecessarily, convoluted.
        [color=blue]
        > I can reflect strings so that you can type something into a field
        > and have it immediately reflected, but have no such luck with
        > splitting that string into an array dynamically and having that
        > reflected.[/color]

        I'm not sure exactly what you mean by "reflected" .
        [color=blue]
        > I'd like to have it take the string typed into a text field, split that
        > along commas in the string into an array, then pass that array as a
        > variable to a parameter in another function.[/color]

        anotherFunction (string.split(/,/g));

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • e271828

          #5
          Re: Eval(array)

          Thanks, everyone, for the replies. I ended up getting the dynamic bar
          chart to work after a decent amount of head-banging. The chart can be
          found here: http://people.umass.edu/eweitz/chaht.html. To use it,
          enter positive numbers separated by commas (without spaces) into the
          text field. The script takes the values of the text field and, on a
          key release, makes them comma-separated values which are fed into an
          array for client-side processing. The Javascript can be found at
          http://people.umass.edu/eweitz/barchart.js.

          Comment

          Working...