Visual Basic and JavaScript

From: Balex (Balex_at_discussions.microsoft.com)
Date: 09/17/04


Date: Fri, 17 Sep 2004 08:17:01 -0700

Hi wise guys,

I have taken up VB again after years of interruption, where I developed with
other tools, including recently Dreamweaver (DW). With DW, I did a prototype
of an app, using ASP, Javascript and Access, that had quite a bit of
Javascript code.

After having received, installed and tried out VSnet with a walkthrough, I
decided to do a small portion of my DW app in VB, as a web form. The part of
accessing the DB (SQLServer) went well, so I decided to take it a step
further and to add a small script which I had in the DW app to a cell of a
table in VB. That did NOT work, regardless of how I tried. Here is the
current code snippet (part of the HTML code of the Web form), which at least
doesn't produce any compile error, but just an exec error on which I can
continue:

<TR>
  <TD style="WIDTH: 45px; HEIGHT: 23px"><FONT size="2">Datum/Zeit:</FONT></TD>
  <TD style="HEIGHT: 23px">
    <script language="javascript">
        var jetzt = new Date(); Response.
        Response.Write(jetzt.getDate() + "." + (jetzt.getMonth() + 1) + "." +
jetzt.getYear() + " " + jetzt.getHours() + ":" + jetzt.getMinutes());
    </script>
  </TD>
</TR>

The error I get is that 'Response' is not defined...

Pretty simple actually, I just want to print the current date and time in
that cell. In DW, this is a server-side script. I guess it's of course
possible with VB to achieve the same (current date/time in a table cell) in a
different way, but it is NOT what I want to achieve: I have LOADS of scripts
in my DW app, and I would like to know how much of these I ca "import" in the
VB app, and how much I have to modify them.

So I'd like to know:
- why is the Javascript not working
- what do I have to do to make it work
- how much of my DW scripts can I re-use.

Thanks a lot for your help to a VSnet/VB newbie.

Balex



Relevant Pages

  • Re: Question on html / javascript
    ... Post some code, and try a narrower newsgroup, such as an HTML one. ... I would put the JavaScript, as functions, in a block at the top, ... and once there use that.innerHTML = to replace the cell contents. ...
    (comp.programming)
  • Re: Background image of a cell?
    ... do you mean a script without accessing the styles of the cell? ... > How can I change the background image of a cell in my table using ... > JavaScript? ...
    (microsoft.public.scripting.jscript)
  • Re: Close Page
    ... you have to use javascript for this. ... app you need to run the script in the client, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Creating Secure Standalone Binaries for 9/X
    ... I can't figure out how to lock down the app ... so the IP of the script is unprotected. ... does is copy the text of your script into the resource: ... Of course, as Andreas said, it's probably just a matter that the file type ...
    (comp.lang.tcl)
  • Re: Excel hangs
    ... Yup there is quite a lot more to the app - as described in the original post ... the cell F10 is another test cell. ... step over the line and autocalc seems to kick in and bang - dead. ... Also I think you may try to post the Debug.print in the loop. ...
    (microsoft.public.excel.programming)