Leser: 1
10 Einträge, 1 Seite |
<body onload="initEdit('form_content','edit', '')">
$("body").load(initEdit('form_content','edit', ''));
function() {initEdit('form_content','edit', '');}
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Verbessertes Eingabefeld (WYSIWYG-Editor)</title>
<meta name="AUTHOR" content="con-f-use@gmx.net" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="/js/jquery.js" type="text/javascript"></script>
<style type="text/css">
.imagebutton {
width: 20px;
height: 20px;
border: 0px;
border-color: #FF0000;
display: inline; }
#edit {
border: solid 1px #CDCDCD; }
a {
text-decoration:none; }
a:hover {
color: #33FFFF; }
a:visitied {
color:#0000FF;
}
</style>
<script type="text/javascript"><!--
//coded by con-f-use@gmx.net - be fair and do not remove this
$(document).ready(function () {
var formu, ifrm, uagent=navigator.userAgent.toLowerCase(),
isGecko = ( uagent.match('gecko') && navigator.productSub>=20030210 ),
isIE = uagent.match('msie') && !uagent.match('opera') && (!uagent.match('msie 5.5')||!uagent.match('msie 6.'));
$('body').load(function () {initEdit('form_content','edit','')});
function initEdit(strFormu,strEdit,strDefTxt) {
formu = document.getElementById(strFormu);
if (isIE)
ifrm = window.frames[strEdit].document;
if (isGecko)
ifrm = document.getElementById(strEdit).contentWindow.document;
ifrm.designMode = 'on';
if (strDefTxt)
with (ifrm) {
open();
write(strDefTxt);
close();
}
var kids = document.getElementsByTagName('div');
for (i in kids)
if (kids[i].className == 'imagebutton')
kids[i].onclick = tbclick;
document.getElementById(strEdit).contentWindow.focus();
}
function tbclick() {
var id = this.id;
if (id == 'CreateLink' && isIE)
ifrm.execCommand(id);
else {
if (id=='FontName' || id=='FontSize') {
sel = document.getElementById(id).childNodes;
sel = isIE ? sel[0] : sel[1];
arg = sel.options[sel.selectedIndex].firstChild.data; }
else if (id == 'InsertImage')
arg = prompt('Enter a image location:', 'http://');
else if (id == 'CreateLink')
arg = prompt('Enter a URL:','http://');
else
arg = null;
ifrm.execCommand(id,false,arg);
}
}
function processData() {
formu.content.value = ifrm.body.innerHTML;
if( !formu.content.value.replace(/<br>|\s| /ig,'') ) {
alert('You did not enter any Text!');
return false;
}
return true;
}
$('body').load(function () {initEdit('form_content','edit','')});
});
//--></script>
</head>
<body><div style="position:absolute;left:10px;top:10px">
<form onsubmit="return processData()" id="form_content" action="" method="post"><div>
<div class="imagebutton" id="FontSize">
<select>
<option>1</option>
<option>2</option>
<option selected="selected">3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
</div>
<div class="imagebutton" id="FontName">
<select>
<option>Arial</option>
<option selected="selected">Times New Roman</option>
<option>Comic Sans MS</option>
</select>
</div><br />
<div class="imagebutton" id="bold">
<a href="#" onclick="return false" style="font-weight:bold">B</a>
</div>
<div class="imagebutton" id="italic">
<a href="#" onclick="return false" style="font-style:italic">I</a>
</div>
<div class="imagebutton" id="underline">
<a href="#" onclick="return false" style="text-decoration:underline">U</a>
</div>
<div class="imagebutton" id="justifyleft">
<a href="#" onclick="return false">left</a>
</div>
<div class="imagebutton" id="justifycenter">
<a href="#" onclick="return false">center</a>
</div>
<div class="imagebutton" id="justifyright">
<a href="#" onclick="return false">right</a>
</div>
<div class="imagebutton" id="insertorderedlist">
<a href="#" onclick="return false">odered list</a>
</div>
<div class="imagebutton" id="insertunorderedlist">
<a href="#" onclick="return false">unordered list</a>
</div>
<div class="imagebutton" id="CreateLink">
<a href="#" onclick="return false">link</a>
</div><br />
<div class="imagebutton" id="indent">
<a href="#" onclick="return false">indent</a>
</div>
<div class="imagebutton" id="outdent">
<a href="#" onclick="return false">outdent</a>
</div>
<div class="imagebutton" id="InsertImage">
<a href="#" onclick="return false">insert image</a>
</div>
<br /><iframe id="edit" name="edit" width="400" height="200" frameborder="0" marginheight="0" marginwidth="0"></iframe>
<textarea name="content" style="display:none"></textarea>
<div style="width: 400px;" align="right">
<input type="submit" value="Submit!" />
</div>
</div></form>
</div></body></html>
$('body').load(function () {initEdit('form_content','edit','dies ist ein test')});
$('body').load(initEdit('form_content','edit','dies ist ein Test'));
1
2
3
4
5
<script type="text/javascript">
$(document).ready(function () {
$('body').load(function () { alert("funktioniert NICHT") });
});
</script>
1
2
3
4
5
6
7
8
9
10
<script type="text/javascript">
$(document).ready(function () {
alert("funktioniert!");
$('body').load(test);
});
function test () {
alert("hallo welt");
}
</script>
$(window).load(func);
Froschpopo+2008-04-28 20:15:57--Allerdings war das reiner Zufall, dass ich es mit window versucht hatte.
Da kommt ja auch keine Sau drauf, dass sowas mit $("body") nicht funktioniert. Weil: Wo in der Doku steht sowas?
10 Einträge, 1 Seite |