[JS] this.open() error in IE

Pagina: 1
Acties:

  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
Het meest basic scriptje werkt gewoonweg niet.
Ik heb al tijdje geen JS meer gebruikt, maar dit volg ik toch echt niet.

Ik heb een html file met een extern script.
Dat gaat helemaal goed.
Als ik op een knopje klik dan wordt er een functie aangeroepen in dat script.

de functie:
code:
1
2
3
4
5
6
7
8
function displayList() {
    var popwin = this.open (    
        '404.html',
        'bla',      
        'width=250,height=300');    
    popwin.focus();
    alert("blieb");
}

Resultaat in IE:
Invalid Argument, line 3, char 2.
En ook geen Alert op mijn scherm

Het verbazingwekkende hieraan is dat Mozilla dit gewoon eet, en geen enkele foutmelding produceert. Er verschijnt ook keurig het een window met mijn mooie 404 :) Gevolgd door een Alert met de text "blieb".

Iemand een idee wat ik fout doe, of wat ik zou moeten proberen?

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

P&W -> W&G

  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
Op maandag 01 juli 2002 13:24 schreef ACM het volgende:
P&W -> W&G
Ah juist.. bij JS denk ik ook nog aan webscripting & programming.. maar dat had ik dus fout.. Sorry ACM!

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • Thijsmans
  • Registratie: Juli 2001
  • Laatst online: 22:34

Thijsmans

⭐⭐⭐⭐⭐ (5/5)

this.open? nooit van gehoord. window.open wel :)

Privacy-adepten vinden op AVGtekst.nl de Nederlandse AVG-tekst voorzien van uitspraken en besluiten.


  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
Op maandag 01 juli 2002 13:27 schreef Prammenhanger het volgende:
this.open? nooit van gehoord. window.open wel :)
window.open levert prcs hetzelfde op..

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • Thijsmans
  • Registratie: Juli 2001
  • Laatst online: 22:34

Thijsmans

⭐⭐⭐⭐⭐ (5/5)

Sorry, hier werkt hij wel :?

/edit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Untitled</title>
<script>
function displayList() {
    var popwin = this.open (    
        '404.html',
        'bla',      
        'width=250,height=300');    
    popwin.focus();
    alert("blieb");
}
</script>
</head>

<body>
<INPUT type=button onClick=displayList()>


</body>
</html>

Geen geneuk over rag-html, geen zin om op het kwastje van homesite te drukken

* Thijsmans heeft nl. vakantie :)

Privacy-adepten vinden op AVGtekst.nl de Nederlandse AVG-tekst voorzien van uitspraken en besluiten.


  • Hangloozz
  • Registratie: Juli 1999
  • Laatst online: 13-07 17:24

Hangloozz

{ @$%&# }

hier werkt ie ook gewoon (W2K, IE5)
zet alles 'ns op 1 regel...Netscape bijvoorbeeld houdt zowiezo niet van linespan-ing.

www.jurgroessen.nl


  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
Op maandag 01 juli 2002 13:34 schreef Hangloozz het volgende:
hier werkt ie ook gewoon (W2K, IE5)
zet alles 'ns op 1 regel...Netscape bijvoorbeeld houdt zowiezo niet van linespan-ing.
Hij stond ook op 1 regel.. Ik heb hem uit elkaar gahaald om te kijken waar de fout zat.

Ik heb zelf W2K en IE 5.5..
NS doetet hier ook, net als Mozilla dus..

Alleen IE is raar bezig :? :?

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
mijn knopje:

<INPUT TYPE="button" CLASS="button" NAME="list" VALUE="List" onClick="displayList();">

Prammenhanger, jouw script werkt bij mij ook in IE..
Wazig..
En als je een extern script maakt? Ook zeker?

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Je hebt best kans dat IE er niet zo goed tegenkan dat je de window referenced naar een lokale variabele.

probeer dit eens:
code:
1
2
3
4
5
6
7
8
9
10
11
var popwin;

function displayList() {
   popwin = window.open (   
    '404.html',
    'bla',      
    'width=250,height=300'
   );   
   popwin.focus();
   alert("blieb");
}

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
DRM:

Geprobeerd.. het maakte helaas geen verschil :'(

Kan het iets te maken hebben, met het feit dat het in een extern script staat?

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Funcracker:
DRM: drm

Geprobeerd.. het maakte helaas geen verschil :'(

Kan het iets te maken hebben, met het feit dat het in een extern script staat?
Lijkt me stug... Zou je even wat meer source kunnen posten (even de omgeving van alles wat je al verteld hebt). Misschien zit de fout wel ergens waar je het nooit verwacht had :)

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • Funcracker
  • Registratie: Juni 2001
  • Laatst online: 28-04 18:17

Funcracker

The LedZ Collective

Topicstarter
general.js:
code:
1
2
3
4
5
6
7
8
9
10
11
var popwin;

function displayList() {
    popwin = window.open (  
        '404.html',
        'Physicians List',      
            'width=250,height=300');    
        popwin.focus();
    alert("blieb");
    return true;
}

index.html:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<HTML>
<HEAD>
[..]
<BODY>
[..]
<SCRIPT LANGUAGE="javascript" SRC="./scripts/general.js"></SCRIPT>
[..]
<TR>
 <TD heigth="30" CLASS="input">ID</TD>
 <TD height="30" CLASS="input" align=left>
  <INPUT TYPE="text" CLASS="text" NAME="phys" SIZE="5" MAXLENGTH="5" VALUE="{PID}"></INPUT>
  <INPUT TYPE="button" CLASS="button" NAME="list" VALUE="List" onClick="displayList()"></INPUT>
 </TD>
 <TD width="175" heigth="30" CLASS="input">&nbsp;</TD>
</TR>
[..]
</BODY>
</HTML>

Zo ziet het er ongeveer uit :)

I am one hell of a guy, I can do anything I want, only I just don't have the faintest idea what.
Zaphod Beeblebrox, in The Hitch Hiker's Guide To The Galaxy


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

<script></script> tags "horen" eigenlijk in de head thuis.
't is niet verplicht (dacht ik :?), maar wel netter, zeker als het om externe scripts gaat.

Probeer die alert("blieb"); eventjes in het .js bestandje te zetten. Als je die alert krijgt, weet je iig zeker dat het bestand geladen wordt.

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1