Salut,


je n'arrive pas à instancier une classe... si quelqu'un comprend pourquoi

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<title>:: EasyScript - Exemple ::</title>
<script language="JavaScript" src="popup.js"></script>
<script language=javascript">
function classPopup() {
	alert('test de creation');
 
	this.id = "";
	this.posX = 0;
	this.posY = 0;
	this.width = 100;
	this.height = 100;
	this.title = "";
	this.text = "";
	this.colorText = "#000";
	this.colorBg = "#fff";
	this.colorBgTitle = "#000";
	this.colorTextTitle = "#fff";
	this.colorBorder = "#aaa";
	this.colorScroll = "#333";
	this.colorShadow = "#888";
	this.showOnLoad = true;
	this.resizable = true;
	this.adaptToBrowser = true;
	this.showOnlyOneTimePerSession = false;
	this.window = null;
 
	this.display = function() {
		window = new popUp(posX, posY, width, height, id, text, colorBg, colorText, fontStyle, title, colorBgTitle, colorTextTitle, colorBorder, colorScroll, colorShadow, showOnLoad, resizable, adaptToBrowser, showOnlyOneTimePerSession);
		alert('test de display '+text);
	}
 
 
	this.setPosition = function(x,y) {
		posX = x;
		posY = y;
	}
 
	this.setTitle = function(str) {
		title = str;
	}
 
	this.setDimension = function(w,h) {
		width = w;
		height = h;
	}
 
	this.setId = function(str) {
		this.id = str;
	}
 
	this.setText = function(str) {
		this.text = str;
	}
 
	this.setColorText = function(code) {
		this.colorText = code;
	}
 
	this.setColorBg = function(code) {
		this.colorBg = code;
	}
}
 
 
</script>
</head>
<body bgcolor="#0069B3">
<script>
function createPopup() {
	alert("debut " + classPopup);
/*	var myPopup = new classPopup();
	myPopup.setTitle("test de titre");
	myPopup.setText("test de texte");
	alert(myPopup.text);
	myPopup.display();*/
}
</script>
<div onclick="createPopup();">popup</div>
</body>
</html>