Jump to content

Dynamic Width


DimNull

Recommended Posts

Here's the situation:I'm trying to figure out a way to get the users screen resolution and pass it to asp. I can do it in JavaScript and VBscript within the html doc., but then I think I would like to pass this back to the server so I can dynamically change the width of a table or td, etc. etc.

<script language="JavaScript"><!--function myscreen(){var version;var width;var w;browserName=navigator.appName;browserVer=parseInt(navigator.appVersion);if ((browserVer >= 4 & browserName == "Netscape") | (browserVer >= 4 & browserName == "Microsoft Internet Explorer"))version="4";elseversion="3";if (version=="4")width = screen.width;if (width < 801)w = 115;elsew = 0;return(w);}//--></script></head><body><script language="JavaScript"><!--document.write("<td width=\"" + myscreen() + "\" >")//--></script>OR:<script language="vbscript"><!--Dim wDim widthwidth = window.screen.widthIf width < 801 Thenw = 0Elseif width > 800 Thenw = 115End Ifdocument.write("<td width=""" + w + """>")//--></script>

I think the best way to do this is through asp, and the width would be written BEFORE the page is sent, so I would need to get the user's screen width from the user's previous page view :)) Any Ideas???

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...