using vbscript

1

116

looking for assist in using vbscript within the html code. Simply trying to
make a pic visible or not based on a date.

If, then, else.

David
 
T

Thomas A. Rowe

VBScript is only supported in IE browsers under Windows if used as replacement for JavaScript in
HTML pages, otherwise you will need to use ASP, so that the VBScript is processed server-side before
being rendered in a browser.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
http://www.Ecom-Data.com
==============================================
 
J

Jon Spivey

Unless you're only targetting IE - ie on an intranet Javascript would be a
better choice as it's supported on all browsers. Unfortunately javascript's
date handling isn't as nice as VB Script but to get you started say you want
to show the picture only during the month of May something like this

<div style="display:none" id="yourPic">
....your pic.....
</div>
<script type="text/javascript">
var d = new Date();
if(d.getMonth()+1 == 5)document.getElementById("yourPic").style.display='';
// May is month 5 - don't forget to add 1 to d.getMonth() as it's zero
based - Jan is month 0
</script>

If you need to a search for javascript date should help you modify the above
to get what you want.

Cheers,
Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top