---
title: "javascript som inte funkar på Mac???"
type: "forum-thread"
url: "https://www.webforum.nu/amne/javascript/18309-javascript-som-inte-funkar-på-mac"
topic: "JavaScript"
topic_url: "https://www.webforum.nu/amne/javascript"
author: "timedia"
published: "2001-10-09T12:57:00.000Z"
updated: "2001-10-09T15:43:00.000Z"
replies: 2
views: 197
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/javascript/18309-javascript-som-inte-funkar-på-mac"
---

# javascript som inte funkar på Mac???

## #1 — timedia, 2001-10-09T12:57Z

Detta script funkar (enligt uppgift)inte på mac. (Det blir page not found) Någon duktig som hittar felet?

```
<script  language="JavaScript">
<!--
/* Note that screen height and screen width refers to the size of the
   monitor (as opposed to the browser window). */
var screen_width = null;
var screen_height = null;
var resolution = null;
// -->
</script>
<script language="JavaScript1.2">
<!--
screen_width = screen.width;
screen_height = screen.height;
// -->
</script>
<script language="JavaScript1.1">
<!--
if (navigator.appName == "Netscape" && navigator.javaEnabled()) {
 var toolkit = java.awt.Toolkit.getDefaultToolkit();
 if (!screen_width) {
  var screen_size = toolkit.getScreenSize();
  screen_width = screen_size.width;
  screen_height = screen_size.height;
 }
 resolution = toolkit.getScreenResolution();
}
// -->
</script>
<script  language="JavaScript">
<!--
if (screen_width && screen_height) {
 if (!resolution) {
  // Screen width and height have been calculated.
  // You may do whatever you wish with the three calculations here.
  // The example below transfers to another page based on the
  // width of the screen:
  if (screen_width < 700)
   location.href = "big/index.htm";
  else if (screen_width < 900)
   location.href = "small/index.htm";
  else
   location.href = "big/index.htm";
 } else {
  // Screen width, height, AND resolution have been calculated.
  // You may do whatever you wish with the three calculations here.
  // The example below transfers to another page based on the
  // width of the screen:
  if (resolution < 80)
   location.href = "page4.htm";
  else
   location.href = "page5.htm";
 }
} else {
 // screen width, height, or resolution could not be calculated
 // default action goes here
 document.write("<table width=486><tr><td><font color='red'>"
  + "You do not have Java properly installed in order to facilitate "
  + "parsing your screen size and resolution."
  + "</font></td></tr></table>");
}
// -->
</script>
```

Permalänk: https://www.webforum.nu/p/18309

## #2 — g33k, 2001-10-09T14:03Z

Det scriptet fungerar alldeles utmärkt på min Mac.

Meningen med scriptet är juh att skicka besökaren till olika sidor beroende på skärmupploösning.

Det kan inte vara så att det är sidan besökaren blir skickad till som inte existerar och det är därför du får ett 404 error?

Permalänk: https://www.webforum.nu/p/334802

## #3 — Chainsaw, 2001-10-09T15:43Z

Dessutom gör du ju amatörmisstaget att kolla vilken upplösning användaren har, inte hur stort fönstret är.

Permalänk: https://www.webforum.nu/p/334803

---

Tråden på webben: https://www.webforum.nu/amne/javascript/18309-javascript-som-inte-funkar-på-mac
