Javascript's EVAL = VBScript's _____?

Results 1 to 9 of 9

Thread: Javascript's EVAL = VBScript's _____?

  1. #1
    BuhBuh Guest

    Default Javascript's EVAL = VBScript's _____?

    Hi,<BR><BR> What is the VBScript equal of the JavaScript&#039s EVAL function? Just take a look at what I&#039m trying to do:<BR><BR>for i = 0 to 35 <BR> document.write "&#060;td&#062;" & "&#060;input type=&#039text&#039 value=&#039&#039 <BR> name=i size=&#039 7&#039 maxlength=&#039 7&#039&#062;" & "&#060;/td&#062;"<BR>next <BR><BR>I simply want to give the value of i to each textbox in the loop. Please help me..thanks.

  2. #2
    Join Date
    Dec 1969

    Default You do NOT need or want eval

    VBS, at least in version 5 and above, also has eval. But you have zero reason to use it. You wouldn&#039t use it in JS in this situation, either.<BR><BR>You just need:<BR><BR>for i = 0 to 35 <BR>&nbsp;&nbsp;&nbsp;&nbsp;document.write "&#060;td&#062;" & "&#060;input type=&#039text&#039 value=&#039&#039 name=&#039" & i & "&#039" _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;& " size=&#039 7&#039 maxlength=&#039 7&#039&#062;" & "&#060;/td&#062;"<BR>next <BR><BR>Curiosity: You are the umpteenth person I have seen use size=&#039[space]7&#039 or similar. Why? First of all, why the space? Second, why the quotes? It&#039s a simple numeric value; it doesn&#039t need quotes.<BR><BR>And thisn&#039t isn&#039t ASP, really, is it?<BR><BR>

  3. #3
    Shedao Shai Guest

    Default yes master

    I obey master. Kill the presi.... wait a sec.<BR><BR><BR>There is one point that must be mentioned. Using quotes around attribute values is correct html. Simply a purist view but it probably will not matter. This is usually why I use qoutes around numeric values though.

  4. #4
    Join Date
    Dec 1969

    Default Mid("master",2,2) & "s" ??

    Actually, I have heard that future versions of HTML may insist on the quotes. Seems silly to me, but...<BR><BR>Anyway, the quotes don&#039t bug me as much as the spaces. <BR><BR>Value = &#039[space]7&#039<BR><BR>WHY the space? I might not that one of the consequences of doing that is that then, on the next (ASP?) page, if you do<BR><BR>If Request.Form("whatever") = "7" Then<BR><BR>You will *not* get a match!

  5. #5
    SPG Guest

    Default To="The Future"

    Part of the XML spec (the part that *is* written) is that all parameter values are enclosed in quotes. Part of the effort to merge XML and HTML into XHTML -- closing a <BR> tag? ***? -- and generally re-write history such that XML becomes the parent language of HTML rather than a logical conclusion thereof is to make all parameter values have quotes around them in HTML. <BR><BR>Given that most of the current WYSIWIG editors put quotes around parameters, and given that any parameter with a space in it requires quotes already, making it part of "the spec" is just a natural conclusion -- but since "the spec" is the longest running and most often lamented joke of web development, I don&#039t think it will have an impact any time soon.<BR><BR>My $.02<BR>SPG

  6. #6
    Shedao Shai Guest

    Default Avoid spaces in values

    Agreed. There should not be spaces in a value, or any conversion to int will fail. Definitely avoid spaces in values.

  7. #7
    Shedao Shai Guest

    Default RE: To=

    The failure to recognize the spec will cost IBM because of their failure to incorporate alt attributes in the images when they built the Sydney Olympics Web site.<BR><BR>It depends on the user requirements, but if you are looking for the most bang for the buck, some attempts to reach the spec must be made. I Definetly can&#039t call for HTML purity, but developers should attempt to cover the basics of the spec. Any additional html should not break a simple browser like lynx.<BR>

  8. #8
    SPG Guest

    Default Spec

    "The failure to recognize the spec will cost IBM ..."<BR><BR>That&#039s my point, but for the wrong reason. Browers -- what most developers develop to whether they use specifications or not -- view Alts as optional (as are heights and widths and such). <BR><BR>Come to think of it, I can&#039t name a single tag parameter which will cause a page to fail if it doesn&#039t exist. That&#039s the power of the W3C spec -- developers get a lawsuit tossed at them before they get clued into the fact that they&#039re non-compliant.<BR><BR>The problem is that nobody can simply say "Use/Refer to the spec" because there are two browsers in the world (that I know of, namely the latest Mozilla Milestone and MSIE 5.0 Macintosh) that do a decent job of displaying under spec -- and they have less than 10% combined market share. There are a lot of points in the spec (especially involving the is-no-more FONT tag, Cascading Style Sheets and people using a WYSIWIG tool) which will actively provide bad results. See style="font-size: medium" on MSIE 5.x for Windows against Netscape 4.x/6.x .<BR><BR>Ultimately, there will either be a specification enforced by the clients ("Sorry, the author of this page can&#039t code HTML so I&#039m not going to parse it.") or more cases where underqualified developers produce pages that get their corporation sued because the browsers that they&#039re testing on are too forgiving ("Some mere mortal wrote this page, here&#039s what I can make of it...")<BR><BR>Given that Popular Browser MSIE allows you to not bother closing table cells/rows/etc, what do you think the chances of an internally enforced specification are?<BR><BR>My $.02 (after taxes)

  9. #9
    HTMLguilty Guest

    Default RE: Spec

    Will they give us some sort of amnesty, where we get to hand in all our &#039bad&#039 code?

Posting Permissions

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