PDA

View Full Version : Converting JavaScript to VBScript


manos7
08-29-2001, 02:06 AM
The reason why I want to convert from javascript to vbscript is because i want to preload images on my web site so as the first page to be a slow one but the rest to run fast.

So i found a JavaScript code to do the job. The script loads in an array the images (array of objects!!!) The only thing i have to do now is not to lose the contents of the array while navigating through my pages. The only way I know to do this is to store the image array in a session variable!!!

That's the problem! How can I store a Javascript array of images in a Session Array Variable???

After not finding a solution I tried to convert my Javascript code into Vbscript. Everything was ok but one line.

In JavaScript we say:

item[i] = New Image;

Where Item is my array.

In VbScript in order to create an array item as an image we should say something like this:

set item(i) = Server.CreateObject(???)

what is the class i need for the html image?
How can i fill the "???"

That's my problem!!!

Dr. Web
08-29-2001, 12:00 PM
you can do everything with JavaScript.
I still do not understand why you want to convert a working script to a MICROSOFT ONLY scripting language.

As I mentioned before, you can use JavaScript in ASP, and by using this you can create session variables or whatever.

As another alternative, you could post your exact objective here, and let some of the other sharp knives sort it out. You might be making things more difficult for yourself.