ASP generated table into Javascript

Results 1 to 6 of 6

Thread: ASP generated table into Javascript

  1. #1
    Matt G. Guest

    Default ASP generated table into Javascript

    &nbsp;<BR>Hi there --<BR><BR>I am building the admin section of a website, where a validated user enters new values for various tables in a db. In order to have it so the person entering data can rapidly step through various records, I want to stick a whole recordset into javascript and only make a further calls to the db when a save or update is made. <BR><BR>Here is a snip (with less data than the real version) of what the JS will look like:<BR>----------------<BR> // ShopObj is a constructor for making the Shop array...<BR>function ShopObj(ShopName, ShopAdd1, ShopPhone)<BR>{ this.ShopName = ShopName<BR> this.ShopAdd1 = ShopAdd1<BR> this.ShopPhone = ShopPhone<BR>}<BR>var Shop = new Array(100)<BR> <BR>Shop[0] = new ShopObj("1&#062;Stitching Post", "121 Post Lane", "(416) 766-6107");<BR>.<BR>.<BR>Shop[99] = new ShopObj("2&#062;The Sampler", "33 Deforest Rd.", "(416) 760-9383");<BR>--------------<BR>Essentially, I will be loading each record into a JS object, so manipulaitng the data will be easier and quicker.<BR><BR>My question is, am I going to run into memory problems -- or other complications -- with a large amount of objects? I figure each shop will have 15 fields, a few of which will be up to 100 chars. I never anticiapte having more than 500 shops, and therefore 500 shop objects in JS.<BR><BR>Is this too much for JS to handle? I don&#039;t mind insisting that administrators use only IE if that helps (as it often does).<BR><BR>Any input is appreciated....<BR><BR>Sincerely, <BR><BR>Matt G.

  2. #2
    Eddie Campbell Guest

    Default RE: ASP generated table into Javascript

    I&#039;m not sure about the performance implications, my guess is that it should be OK with that amount of data. But one thing to be aware of is that if user A has all the data in a static array, and user B then nips in and changes a record, user A will still have the old values, and worse still runs the risk of overwriting user B&#039;s changes.<BR><BR>It may not be a problem in your scenario, but you do say users rather than user, so I assume this could occur.

  3. #3
    Steve Cimino Guest

    Default I agree

    &#062;&#062;user enters new values for various tables in a db<BR><BR>If you were just &#039;selecting&#039; and viewing records, that wouldn&#039;t be a problem, but like Eddie pointed out, you run the risk of overwriting someone else&#039;s changes.<BR><BR>I don&#039;t think you&#039;ll have performance problems if you&#039;re whacking the db each time. That&#039;s what they&#039;re designed to do -- and it doesn&#039;t sound like you have thousands of users accessing it at the same time.

  4. #4
    Matt G. Guest

    Default RE: I agree

    &nbsp;<BR>Thanks for the responses so far... I am glad to know you don&#039;t think the Javascript will be too cumbersome. There is an almost nil chance that more than one user will update the db at the same time, so I am not concerned about this issue. Also, I know a db can handle being accessed every time someone steps through a recordset, I just don&#039;t like it! The elegance of avoiding db acivity and page refreshes - with instant onscreen updates -- is very appealling to me.<BR><BR>So, I really just want to be sure that having an array of objects in Javascript, with possibly hundreds of separate objects, is feasible. <BR><BR>I&#039;d love ot hear from anyone that has dome something lke this...<BR><BR>Thanks,<BR><BR>Matt G.<BR><BR>

  5. #5
    Steve Cimino Guest

    Default RE: I agree

    Have you thought of using a Java Applet instead? You can get instant updates that way also... and with the added power of Java over JavaScript.

  6. #6
    Matt G. Guest

    Default RE: I agree

    *<BR>Hey Steve,<BR>even if I wanted to I couldn&#039;t use Java; my Java knowledge is beginner level at best. That said, I don&#039;t really like applets much anyway, and try to avoid using them on my websites.<BR><BR>I do appreciate yor suggestions.<BR><BR>Sincerely, <BR><BR>Matt G.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts