MarkRadaba
Technical User
How can I pass a variable in JavaScript to a variable in ASP? For example, in JavaScript, I'm setting a variable to screen.width.... how can I then pass that value to a variable in ASP?
-Mark
-Mark
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script type="text/javascript">
function test() {
var imgObj = document.getElementById('testImg');
alert(imgObj.width);
alert(imgObj.height);
}
onload = test;
</script>
</head>
<body>
<img id="testImg" src="example.gif"/>
</body>
</html>
It's quite easy to access the size of the browser window. The [tt]clientHeight[/tt] and [tt]clientWidth[/tt] properties of the [tt]body[/tt] will provide that information.MarkRadaba said:My problem has always been trying to get a graphic resized based on the screen resolution.