Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Monday, December 1, 2008

Object Oriented JAVASCRIPT TUTORIALS Redefining an Existing Method : prototype



Function.prototype.toString = function () {
return "Function code hidden";
};
function sayHi() {
alert("hi");
}

alert(sayHi.toString());


Function.prototype.originalToString = Function.prototype.toString;

Function.prototype.toString = function () {
if (this.originalToString().length > 100) {
return "too long.";
} else {
return this.originalToString();
}
};





Object Oriented JAVASCRIPT TUTORIALS- prototype

Friday, October 17, 2008

JAVASCRIPT DHTML TUTORIALS » Event onMethod

1. oAbort (1)
2. oActivate (1)
3. oAfterPrit (1)
4. oAfterUpdate (1)
5. oBeforeActivate (1)
6. oBeforeCopy (1)
7. oBeforeCut (1)
8. oBeforeDeactivate (1)
9. oBeforeEditFocus (1)
10. oBeforePaste (1)
11. oBeforePrit (1)
12. oBeforeUload (1)
13. oBeforeUpdate (1)
14. oBlur (1)
15. oBouce (1)
16. oCellChage (1)
17. oChage (1)
18. oClick (1)
19. oCotextMeu (1)
20. oCotrolSelect (1)
21. oCopy (1)
22. oCut (1)
23. oDataAvailable (1)
24. oDatasetChage (1)
25. oDatasetComplete (1)
26. oDblClick (1)
27. oDeactivate (1)
28. oDrag (1)
29. oDragEd (1)
30. oDragEter (1)
31. oDragLeave (1)
32. oDragOver (1)
33. oDragStart (1)
34. oDrop (1)
35. oError (1)
36. oErrorUpdate (1)
37. oFilterChage (1)
38. oFiish (1)
39. oFocus (1)
40. oFocusI (1)
41. oFocusOut (1)
42. oHelp (1)
43. oKeyDow (1)
44. oKeyPress (1)
45. oKeyUp (1)
46. oLayoutComplete (1)
47. oLoad (1)
48. oLoseCapture (1)
49. oMouseDow (1)
50. oMouseEter (1)
51. oMouseLeave (1)
52. oMouseMove (1)
53. oMouseOut (1)
54. oMouseOver (1)
55. oMouseUp (1)
56. oMouseWheel (1)
57. oMove (1)
58. oMoveEd (1)
59. oMoveStart (1)
60. oPaste (1)
61. oPropertyChage (1)
62. oReadyStateChage (1)
63. oReset (1)
64. oResize (1)
65. oResizeEd (1)
66. oResizeStart (1)
67. oRowEter (1)
68. oRowExit (1)
69. oRowsDelete (1)
70. oRowsIserted (1)
71. oScroll (1)
72. oSelect (1)
73. oSelectioChage (1)
74. oSelectStart (1)
75. oStart (1)
76. oSubmit (1)
77. oTimeError (1)
78. oUload (1)
79. Access Key (1)
80. Alt Key (2)
81. Evet Properties (21)
82. Geeral Evet (7)
83. Hyper Lik Evet (7)
84. Key Evet (15)
85. Mouse Evet (22)
86. Mouse (2)
87. Page Load (1)

Wednesday, October 8, 2008

DHTML GUI Components

Colection of GUI Components
.
Animation (39)
Banner (1)
Calendar International (2)
Calendar (39)
Chart (1)
Clock (10)
Code Formatter (1)
Color Chooser (5)
ComboBox (4)
Cursor (2)
Desktop (2)
Documentation (1)
Drag Drop (22)
Dual List (1)
Editor (9)
Events Calendar (1)
Grid Layout (17)
IFrame (1)
Key Event (1)
Log Panel (1)
Menu (32)
Navigation Bar (3)
Outlook Bar (1)
Popup Menu (2)
RadioButton (2)
Scroll (9)
ScrollBar (4)
Slider (6)
Sortable Listbox (1)
Syntax HighLighter (1)
Tab (13)
Table Grid (45)
TextArea (1)
TextBox (1)
Ticker (7)
Time Picker (2)
Toggle (5)
ToolBar (3)
Tree Table (1)
Tree (26)





Try It online :

http://www.navioo.com/javascript/dhtml/GUI_Components_227.dhtml

Friday, October 3, 2008

AutoComplete Widgets

JAVASCRIPT DHTML TUTORIALS » Ajax Layer » AutoComplete Widgets »


AutoComplete Widget

Thursday, October 2, 2008

Image Cropper Online

JAVASCRIPT DHTML TUTORIALS » Page Components » Image Cropper
1 . Preview Cropped Image Preview Cropped Image
2 . Minimum (single axis) dimension test Minimum (single axis) dimension test
3 . Minimum (both axes ) dimension test Minimum (both axes ) dimension test
4 . Fixed ratio test Fixed ratio test
5 . Test of dynamically changing images or removing and re-applying the cropper Test of dynamically changing images or removing and re-applying the cropper
6 . Test of applying different dimension restrictions to the cropper Test of applying different dimension restrictions to the cropper
7 . Test page with relatively positioned wrapper Test page with relatively positioned wrapper
8 . Test page with floating wrapper Test page with floating wrapper
9 . CSS - Absolute positioned (and draggable) test CSS - Absolute positioned (and draggable) test
10 . Loading & displaying co-ordinates (with ratio) of crop area on attachment test Loading & displaying co-ordinates (with ratio) of crop area on attachment test
11 . Loading & displaying co-ordinates of crop area on attachment test Loading & displaying co-ordinates of crop area on attachment test
12 . Basic cropper test Basic cropper test
Try online the examples of Javascript Image Cropper

Wednesday, October 1, 2008

How to animate an element's position using the Motion subclass

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Motion Example - Basic</title>

<style type="text/css">

/*

Copyright (c) 2006, Yahoo! Inc. All rights reserved.

Code licensed under the BSD License:

http://developer.yahoo.net/yui/license.txt

Version: 0.10.0

*/



body {

   
margin:0;

   
font:small arial;

}



h1 {

   
color:#666;

   
margin:0;

   
font:bold 150% palatino, georgia;

}



#hd img {

   
vertical-align:middle;

}



#hd h1 {

   
display:inline;

   
margin:0 0 0 20px;

   
vertical-align:middle;

}



ul, li {

   
margin:0;

   
padding:0;

   
list-style:none;

}



#doc {

   
margin:10px;

}



#examples {

   
margin:60px 40px;

}



#examples li {

   
margin-bottom:1em;

}



#examples li a {

   
color:#666;

   
font:85% verdana;

}



#demo {

   
background:#ccc;

   
font:100%/1.2em arial;

   
width:10px;

   
height:10px;

}



#animation-demo-scroll #demo p {

   
width:600px;

}



#animation-demo-motion #demo {

   
color:yellow;

   
font-size:0;

}



#animation-demo-size-plus #demo, #animation-demo-fade #demo, #animation-demo-colors #demo {

   
background:#ccc;

   
font:100%/1.2em arial;

   
width:200px;

   
height:200px;

}

#animation-demo-colors #demo {

   
border:3px solid #c3c;

}



#animation-demo-scroll #demo {

   
width:400px;

   
height:200px;

   
overflow:auto;

}



#animation-demo-colors #demo {



}



#target {

   
background:red;

   
font-size:0;

   
position:absolute;

   
left:300px;top:300px;

   
width:10px;

   
height:10px;

}



</style>



<script type="text/javascript" src="./build/yahoo/yahoo.js"></script>

<script type="text/javascript" src="./build/event/event.js"></script>

<script type="text/javascript" src="./build/dom/dom.js"></script>

<script type="text/javascript" src="./build/animation/animation.js"></script>



<script type="text/javascript">

YAHOO.example.init = function() {   

   
var anim = new YAHOO.util.Motion('demo', { points: { to: YAHOO.util.Dom.getXY('target') } });

   
YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);

};



YAHOO.util.Event.onAvailable('demo', YAHOO.example.init);

</script>



</head>

<body id="animation-demo-motion">

<div id="doc">

   
<h1>Motion Example - Basic</h1>

   
<p>This example demonstrates how to animate an element's position using the Motion subclass.</p>

   
<p>Click anywhere to start animation.</p>

   
<div id="demo"></div>  

   
<div id="target"></div>

</div>

</body>

</html>






Yui required !!!!

Try it online

Monday, September 29, 2008

Ajax Layer Ajax Library Examples

Large examples collection of Ajax Library : Ajax Layer JAVASCRIPT DHTML TUTORIALS

See at work :demo online Ajax Library : Ajax Layer

Wednesday, September 24, 2008

Web Browser Javascript Benchmark

How does your favorite browser's Javascript engine speed compare to other popular browsers? The speed of your browser's Javascript is becoming more and more important because of Web 2.0's reliance on Ajax and complex Javascript libraries. I have written a benchmark test, which you can run on your machine at home, to compare the newest versions of Internet Explorer, Opera, Safari, and Firefox. How does your favorite browser stand up to the competition?

See the results here

Friday, September 19, 2008

HOW to - DHTML Menu Tutorials

249.7 . Vertical layout menu Vertical layout menu
249.8 . Customizable layout Customizable layout
249.9 . Add/delete menu items Add/delete menu items
249.10 . Build a simple fancy menu Build a simple fancy menu
249.11 . Simple drop-down menu example with layer Simple drop-down menu example with layer
249.13 . Slide out menu with i18N Slide out menu with i18N
249.14 . Menu and submenu
249.15 . Dynamic menu
249.16 . Slide out menu
249.17 . Complete Source Code for the Menu
249.18 . popup menu (content sensitive menu)
249.19 . Menu based on Javascript
249.20 . Menu with sound

Source code and demo online

Tuesday, September 2, 2008

AJAX PHR RSS Reader Step by Step Tutorial

Tutorial whith Demo about writing an AJAX RSS Reader. This AJAX reader is written in Javascript only, it just request a backend url on the same server then display the feed resulted as you can see in the screenshots below :

Preparing the XMLHttpRequest Object
In the first step the application prepared an XMLHttpRequest object to use it for loading remote RSS data. I tested the code with firefox only, but I added ActiveXObject in case IE was used.

   var RSSRequestObject = false; // XMLHttpRequest Object

if (window.XMLHttpRequest) // try to create XMLHttpRequest
RSSRequestObject = new XMLHttpRequest();

if (window.ActiveXObject) // if ActiveXObject use the Microsoft.XMLHTTP
RSSRequestObject = new ActiveXObject("Microsoft.XMLHTTP");

Writing the HTML code
Just few lines are enough, two divs are used by the application the status will inform about the progress of requesting data, and the ajaxreader will be the container in which the result will be displayed. The first thing then to do onload page is to run the AJAX Reader.

  

AJAX RSS Reader





The AJAX RSS Reader

The AJAX Reader will request the backend URL and run a function ReqChange() when the data will be loaded. I have just added few additional function for usability purpose to display the status and hide it ...

 var
Backend = 'rss.php'; // Backend url .....
Read complete article
You can find the AJAX RSS Reader
script running online

Open Source Scripts and Programs Ajax Javascript

Thousands of open source Javascript /Ajax projects
XML parsers
Content Editors
Image processing

MySQL to JSON

Add to simplicity and might even save some valuable server time. If you're running MySQL 4.1 or later you can use the nifty function GROUP_CONCAT() together with the normal CONCAT() function to build all your JSON straight from your SQL query.
username email
tommy tommy@tommysplace.com
jane jane@examples.com
jack jack@iford.com
Our SQL table.
SELECT
CONCAT("[",
GROUP_CONCAT(
CONCAT("{username:'",username,"'"),
CONCAT(",email:'",email),"'}")
)
,"]")
AS json FROM users;
A MySQL-query that returns JSON.
[
{username:'tommy',email:'tommy@tommysplace.com'},
{username:'jane',email:'jane@examples.com'},
{username:'jack',email:'jack@jiford.com'}
]
The returned JSON structure.

AJAX Speed Up the Web

In the AJAX tutorial below we will demonstrate how a web page can be loaded 10 time faster using ajax.

This is the HTML page . It contains a simple HTML table,couple css rules and a link to a JavaScript