---
title: "Scriptproblem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/javascript/108420-scriptproblem"
topic: "JavaScript"
topic_url: "https://www.webforum.nu/amne/javascript"
author: "elf88"
published: "2004-08-03T11:09:06.000Z"
updated: "2004-08-04T05:28:02.000Z"
replies: 3
views: 264
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/108420-scriptproblem"
---

# Scriptproblem

## #1 — elf88, 2004-08-03T11:09Z

Tjena, har aldrig använt Java förr, men om man nu får en kod som den som e nedanför. Vart ska man sätta in den i t.ex. start.htm?

Script
\<script type="text/javascript"\>
/\*  The code contained in this  file is copyrighted by <https://www.jojoxx.net>
The file may be used for none commercial applications and distributed
as long as these lines remain intact.  The file or part of it may not
be sold  or  included  in any  other commercial  application  without
agreement from the author. If you have questions or comments, contact
the author at <http://www.jojoxx.net>

© Copyright - <https://www.jojoxx.net> \- 2004                                \*/

function imgPopup4(url){
        MyWin = window.open("","","scrollbars=no,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,width=100,height=100");
        with(MyWin.document){
        open();
        write("\<html\>\\n\<head\>\<scr"+"ipt\>");
        write("window.onresize=function(){if(document.getElementById){\\ndocument.getElementById('myimg').style.width=(document.all)?document.body.clientWidth:window.innerWidth;\\ndocument.getElementById('myimg').style.height=(document.all)?document.body.clientHeight:window.innerHeight;\\n}}\\n");
        write("awidth=(document.layers)?0:8;awidth+=(document.all)?4:0;aheight=(document.layers)?0:29;\\n");
        write("window.onload=function(){ window.resizeTo(document.images\[0\].width+awidth,document.images\[0\].height+aheight); window.moveTo(parseInt(screen.width/2-document.images\[0\].width/2),parseInt(screen.height/2-document.images\[0\].height/2));\\n");
        write("if(document.all) document.all\['wait'\].style.visibility='hidden';\\n");
        write("if(document.layers) document.layers\['wait'\].visibility='hide';\\n");
        write("if(document.getElementById) document.getElementById('wait').style.visibility='hidden';\\n");
        write("}\\n\</scr"+"ipt\>\\n");
        write("\<title\>Bildvisare\</title\>\\n\</head\>\\n\<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0 style=\\"overflow:hidden;\\"\>\\n");
        write("\<div id='wait' style='position:absolute;top:0px;left:0px;width:100px;height:100px;background-color:rgb(0,0,200);color:white;font:bold 12px Arial;'\>\<p\> \</p\>\<p\>Vänta...\<br\>Bilden laddas\</p\>\</div\>\\n");
        write("\<img id='myimg' src=\\""+url+"\\"\>\\n");
        write("\</body\>\\n\</html\>\\n");
        close();
        }
}
\</script\>
\<a href="../../images/www.jojoxx.net.onscreen.gif" onClick="imgPopup4(this.href); return false;"\>Visa bild\</a\>

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

## #2 — Jojoxx, 2004-08-03T11:52Z

Detta Java**Script** kan du lägga i princip var som hellst på sidan. Prova och lägg upp det på en sida så ser du. Skulle det inte fungera kan du skriva igen och lämna en länk till sidan.

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

## #3 — elf88, 2004-08-03T21:01Z

Japp, d funkade.
Men om ja nu vill ha bilden som länk, asså om man trycker på en liten bild öppnas ett stort fönster med bilden i? Hur gör ja d ? Just nu står det ju Klicka här typ

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

## #4 — Jojoxx, 2004-08-04T05:28Z

Byt ut "Visa bild" mot bilden i fråga. (\<img src="bilden.gif" border="0"\>)

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

---

Tråden på webben: https://www.webforum.nu/amne/javascript/108420-scriptproblem
