Downloaden op scherm resolutie

Status
Niet open voor verdere reacties.

apollo93

Gebruiker
Lid geworden
10 nov 2006
Berichten
160
Ik heb deze pagina aangemaakt zodat als iemand op "download" drukt het HTML bestand met de scherm resolutie van die persoon word aangegeven,, alleen zit en een fout in de JS en k weet niet wat het is:confused: (k ben net begonnen met JS dus t kan een best grote fout zijn:p )

HTML:
<html>

<head>
<title>Costom Theme Pack by Apollo v2</title>
<link rel="stylesheet" type="text/css" href="NIET INKIJKEN/CSS & HTML/Stylesheet.css" >
<script language="JavaScript" type="text/javascript"> 
 <!--
function open() {
	if {screen.width == 800, screen.height == 600, this.href('NIET INKIJKEN/index - 600 x 800.html');}
	if {screen.width == 1024, screen.height == 800, this.href('NIET INKIJKEN/index - 800 x 1024.html');}
	if {screen.width == 1280, screen.height == 1024, this.href('NIET INKIJKEN/index - 1024 x 1280.html');}
	if {screen.width == 480, screen.height == 272, this.href('NIET INKIJKEN/index - 480 x 272.html');}
	else {this.href('NIET INKIJKEN/index - schermresolutie.html');}
	}
-->
</script>
</head>

<body>
<table height="100%" width="100%"><tr><td>
  <table border align="center" width="500px">
    <tr>
      <td align="center" height="30px">
        <h2>Costom Theme Pack by Apollo V2</h2>
      </td>
    </tr>
    <tr>
      <td>
        <center>
          <br>
          <a href="#" onclick="open()">Download</a>
          <br>
          <br>
        </center>
     </td>
  </tr>
</table>
</td></tr></table>
</body>

</html>

Alvast bedankt, doeg
 
Laatst bewerkt:
Zo: :)
PHP:
<script type="text/javascript"> 
 <!--
  function makeLink(id) {
   id.href = 'NIET INKIJKEN/index - schermresolutie.html';
   if (screen.width ==  800 && screen.height ==  600) id.href = 'NIET INKIJKEN/index - 600 x 800.html';
   if (screen.width == 1024 && screen.height ==  768) id.href = 'NIET INKIJKEN/index - 768 x 1024.html';
   if (screen.width == 1280 && screen.height == 1024) id.href = 'NIET INKIJKEN/index - 1024 x 1280.html';
   if (screen.width ==  480 && screen.height ==  272) id.href = 'NIET INKIJKEN/index - 480 x 272.html';
   return true;
   };
 -->
</script>

<a href="#" onclick="makeLink(this)">Download</a>
http://www.ivobrugge.be/cursusweb/javascript/structuren.asp is een goede cursus. ;)


Vr.Gr Egel.
 
Heej:shocked:

eerste x werkte het script wel,, maar nu zecht ie opeens elke x "fout op de pagina":confused:

Nog iemand een ander script?:o

doeg,.
 
Kun je de html-code van de pagina posten?

En wat is de foutmelding? Die zie je als je dubbelklikt op het uitroeptekentje linksonder in het Explorer venster.


Vr.Gr. Egel.
 
HTML:
<html>

<head>
<title>Costom Theme Pack by Apollo v2</title>
<link rel="stylesheet" type="text/css" href="http://home.hetnet.nl/~jeroenbeekman/losse bestanden/Stylesheet.css" >
<script type="text/javascript">  
 <!-- 
  function makeLink(id) { 
   id.href = 'index - schermresolutie.html'; 
   if (screen.width ==  800 && screen.height ==  600) id.href = '800 x 600/index.html'; 
   if (screen.width == 1024 && screen.height ==  768) id.href = '1024 x 800/index.html'; 
   if (screen.width == 1280 && screen.height == 1024) id.href = '1280 x 1024/index.html'; 
   return true; 
   }; 
 --> 
</script>
</head>

<body onload="makeLink(this)">
<table height="100%" width="100%"><tr><td>
  <table border align="center" width="500px">
    <tr>
      <td align="center" height="30px">
        <h2>...::: Costom Theme Pack by Apollo V2 :::...</h2>
      </td>
    </tr>
    <tr>
      <td>
        <center>
          <br>
          <a href="#" onclick="makeLik(this)">Download</a>
          <br>
          <br>
        </center>
     </td>
  </tr>
</table>

<br><br><br>

  <table border align="center" width="500px">
    <tr>
      <td colspan="3" align="center" height="30px">
        <h2>...::: Info :::...</h2>
      </td>
    </tr>
    <tr>
      <td>
        naam:
     </td>
      <td>
        groote:
     </td>
      <td>
        beschrijving:
     </td>
  </tr>
    <tr>
      <td>
        Costom Theme Pack by Apollo v2
     </td>
      <td>
        20 MB (In totaal 100 MB)
     </td>
      <td>
        Costom Theme Pack met ALLE nieuwe hacks
     </td>
  </tr>
</table>

<br><br><br>

  <table border align="center" width="500px">
    <tr>
      <td colspan="3" align="center" height="30px">
        <h2>...::: Sponsort by :::...</h2>
      </td>
    </tr>
    <tr>
      <td>
<center>
<h4>*sponsors*</h4>
</center>
     </td>
  </tr>
</table>

</td></tr></table>
</body>

</html>

De foutmelding:

Regel: 31
teken:1
fout: Object word verwacht
code: 0

K weet niet wat het betekent,, maar t lijkt erop dat hij de link niet vind,, alleen kloppen de links wel...
 
onclick="makeLink(this)" moet het zijn, ennetje vergeten. :)

En moet het niet: '1024 x 768/index.html' zijn?


Vr.Gr. Egel.
 
ow, is dat de resolutie dan? ik d8 800,, moet ik mijn html ff aanpassen:o

thnx, doeg
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan