Wednesday, December 28, 2011

Key codes for java script


Key Code Reference Table

0
10
20
Caps Lock
30
40
Arrow Down
1
11
21
31
41
2
12
22
32
42
3
13
Enter
23
33
Page Up
43
4
14
24
34
Page Down
44
5
15
25
35
End
45
Insert
6
16
Shift
26
36
Home
46
Delete
7
17
Ctrl
27
Esc
37
Arrow Left
47
8
Backspace
18
Alt
28
38
Arrow Up
48
0
9
Tab
19
Pause/Break
29
39
Arrow Right
49
1
50
2
60
70
f
80
p
90
z
51
3
61
=+
71
g
81
q
91
Windows
52
4
62
72
h
82
r
92
53
5
63
73
i
83
s
93
Right Click
54
6
64
74
j
84
t
94
55
7
65
a
75
k
85
u
95
56
8
66
b
76
l
86
v
96
0 (Num Lock)
57
9
67
c
77
m
87
w
97
1 (Num Lock)
58
68
d
78
n
88
x
98
2 (Num Lock)
59
;:
69
e
79
o
89
y
99
3 (Num Lock)
100
4 (Num Lock)
110
. (Num Lock)
120
F9
130
140
101
5 (Num Lock)
111
/ (Num Lock)
121
F10
131
141
102
6 (Num Lock)
112
F1
122
F11
132
142
103
7 (Num Lock)
113
F2
123
F12
133
143
104
8 (Num Lock)
114
F3
124
134
144
Num Lock
105
9 (Num Lock)
115
F4
125
135
145
Scroll Lock
106
* (Num Lock)
116
F5
126
136
146
107
+ (Num Lock)
117
F6
127
137
147
108
118
F7
128
138
148
109
- (Num Lock)
119
F8
129
139
149
150
160
170
180
190
.>
151
161
171
181
191
/?
152
162
172
182
My Computer
192
`~
153
163
173
183
My Calculator
193
154
164
174
184
194
155
165
175
185
195
156
166
176
186
196
157
167
177
187
197
158
168
178
188
,<
198
159
169
179
189
199
200
210
220
\|
230
240
201
211
221
]}
231
241
202
212
222
'"
232
242
203
213
223
233
243
204
214
224
234
244
205
215
225
235
245
206
216
226
236
246
207
217
227
227
227
208
218
228
238
248
209
219
[{
229
239
249

Monday, November 21, 2011

AJAX Notes


AJAX
1.      AJAX= Asynchronous JavaScript and XML
2.      AJAX applications are Browser and platform independent
3.      XMLHttpRequest object: - is used to exchange data with a server behind the scenes. This means that it is possible to update parts of a web page without reloading the whole page.
4.      Syntax for creating XMLHttpRequest object:
Variable xmlhttp =new XMLHttpRequest ();      //for IE 7+, Firefox and chrome
Variable xmlhttp = new ActiveXObject (“Microsoft.XMLHTTP”);     //for IE 5 and IE 6
5.      To handle both type of browser:
Var xmlhttp;
If (window.XMLHTTPRequest)
{
// code for IE 7+, Firefox, chrome, opera, safari
            Xmlhttp= new XMLHTTPRequest ();
}
Else
{
            // code for IE 5 and IE 6
            Xmlhttp= new ActiveXObject (“Microsoft.XMLHTTP”);
}
6.      to send a request to a server, we use open() and send() methods of XMLHttpRequest object
xmlhttp.open (“GET”,”ajax.info.txt”,true);
xmlhttp.send ();
7.      Syntax is:
Open (method,URL,async)
Send (String)  //String is only used for post
8.      Two XMLHttpRequest object properties are:
a.      responseText
b.      responseXML
9.      the onereadystatechange event is triggered every time the ready state changes.
10.  Three important properties of the XMLHttpRequest object:
Property
Description
onreadystatechange
Stores a function (or the name of a function) to be called automatically each time the readyState property changes
readyState
Holds the status of the XMLHttpRequest. Changes from 0 to 4: 
0: request not initialized 
1: server connection established
2: request received 
3: processing request 
4: request finished and response is ready
status
200: "OK"
404: Page not found

Thursday, November 17, 2011

JQuery short notes


1.      JQuery is a JavaScript library
2.      Features of JQuery
·        HTML element selection
·        HTML element manipulation
·        CSS manipulation
·        HTML event functions
·        JavaScript effect and animation
·        AJAX
·        Utilities
3.      To add  JQuery to a page
<head>
<script type=”text/javascript” src=”jquery.js”>
</script>
</head>
JQury tag should be inside <head > tag
4.      Two version of JQuery are available
·        Minified
·        Uncompressed( for debugging and testing purpose)
5.      To use hosted library from Google
<head>
<script =”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”>
</script>
</head>
6.      JQuery Syntax:
$(selector).action()
7.      Document Ready function skeleton
$(document).ready(function){
-         - - - - - - - -
-          - - - - - - - -
-          - - -- - - - - -
});
This is done to prevent any JQuery code from running before the document is finished loading
Ex.:-     Trying to hide an element that doesn’t exist
            Trying to get size of an image that is not loaded
8.                  JQuery selector allows to select HTML element by
·        Element name
·        Attribute name
·        Content
9.      Element selector example:
·          $("p") selects all <p> elements.
·          $("p.intro") selects all <p> elements with class="intro".
·          $("p#demo") selects all <p> elements with id="demo".
10.  Attribute selection Example: jQuery uses XPath expressions to select elements with given attributes.
·          $("[href]") select all elements with a href attribute.
·          $("[href='#']") select all elements with a href value equal to "#".
·          $("[href!='#']") select all elements with a href attribute NOT equal to "#".
·          $("[href$='.jpg']") select all elements with a href attribute that ends with ".jpg".
11.  CSS selection example:
·          $("p").css("background-color","blue");
12.  Some more Examples

Selector
Example
Selects
*
$("*")
All elements
.class.class
$(".intro.demo")
All elements with the classes "intro" and "demo"
$("p:first")
The first p element
$("p:last")
The last p element
$("tr:even")
All even tr elements
$("tr:odd")
All odd tr elements



$("ul li:eq(3)")
The fourth element in a list (index starts at 0)
$("ul li:gt(3)")
List elements with an index greater than 3
$("ul li:lt(3)")
List elements with an index less than 3
$("input:not(:empty)")
All input elements that are not empty
$(":animated")
All animated elements
$(":contains('W3Schools')")
All elements which contains the text
$(":empty")
All elements with no child (elements) nodes
$("[href='default.htm']")
All elements with a href attribute value equal to "default.htm"
$("[href$='.jpg']")
All elements with a href attribute value ending with ".jpg"
13.  To put JQuery functions in a separate file is always a god idea. To use that js file
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="my_jquery_functions.js"></script>
</head>
14.              The jQuery noConflict() method specifies a custom name (like jq), instead of using the dollar sign.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var jq=jQuery.noConflict();
-          jq(document).ready(function(){
-          - - - - 
-          - - - -
  });
});
</script>
</head>
</html>
15.        The syntax of jQuery's method for making custom animations is:
$(selector).animate({params},[duration],[easing],[callback])
16.        JavaScript statements are executed line by line. However, with animations, the next       line of code can be run even though the animation is not finished. This can create errors. To prevent this, you can create a callback function. A callback function is executed after the current animation (effect) is finished.

17.        Changing HTML Content

·          $(selector).html(content)

·          $(selector).append(content)
·          $(selector).prepend(content)

·          $(selector).after(content)

·          $(selector).before(content)

18.  The css() method has three different syntaxes, to perform different tasks.

·          css(name) - Return CSS property value
·          css(name,value) - Set CSS property and value
·          css({properties}) - Set multiple CSS properties and values

 

19.  The jQuery load() method is a simple (but very powerful) AJAX function. It has the following syntax:
$(selector).load(url,data,callback)

20.  $.ajax(options) is the syntax of the low level AJAX function.





Monday, October 10, 2011

increasing the JBoss server start-up time in eclipse


For increasing the JBoss server start-up  time in eclipse:-

1.Click the Servers tab. Its located at the lower area of Eclipse workarea. Just beside Properties tab or near the Console tab.




2.Then double click the server(don't right click) which you are trying to start. It will open a dialog box. Expand the “Timeouts”. There you can find the option to increase the server start time. The default value is 50 seconds you can change it to an appropriate value(it is highlighted by green rectangle in image


I hope this solve your server time out issue.

:)