LC Server - Check for Screen size?

Rick Harrison harrison at all-auctions.com
Sat Mar 20 20:02:02 EDT 2021


Hi Matthias,

So you are thinking something like:

<!DOCTYPE html>
<html>
<body>

<h3>Your Screen:</h3>

<div id="demo"></div>

<script>
var txt = "";
txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>";
txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight + "</p>";
txt += "<p>Color depth: " + screen.colorDepth + "</p>";
txt += "<p>Color resolution: " + screen.pixelDepth + "</p>";

document.getElementById("demo").innerHTML = txt;
</script>

</body>
</html>

And then put the information into a Javascript cookie and then read the cookie value with an LC Server script.

I’ll see if I can get that to work.

Thanks!

Rick

> On Mar 20, 2021, at 6:10 PM, matthias rebbe via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> As Livecode Server runs on the server  there is no direct command/function in LC Server available for this task.
> 
> But you could use Javascript (document.cookie)  in your LC Server script  to write the screen resolution into a cookie and read that cookie then with your Livecode Server script.
> 
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code




More information about the use-livecode mailing list