Watch and enjoy
http://www.worldsgreatestbusinessmind.com/20090104-Mohit-Bansal-create.html&WT.mc_id=WGBM|Create
Watch and enjoy
http://www.worldsgreatestbusinessmind.com/20090104-Mohit-Bansal-create.html&WT.mc_id=WGBM|Create
Posted in Technical | Leave a Comment »
Posted in Technical | Tagged xml, xml parsing | Leave a Comment »
Using JQuery, we can simply make Ajax call. JQuery provides us simple methods to make Ajax call using GET or POST. We can use any of these HTTP methods to make Ajax request using JQuery.
1. $.get() : Load a remote page using an HTTP GET request.
Syntax: $.get(String url, Map params, Function callback) returns XMLHttpRequest
Example 1: simple ajax call using $.get()
$.get(“test.php”);
Example 2: ajax call with parameter in query string
$.get(“test.php”, { name: “mohit”, age: “24″ } );
Example 3: ajax call handles response
$.get(“test.php”, function(data){
alert(“Ajax call complete”);
});
Example 4: ajax call with parameter in query string and handles response
$.get(“test.php”,
{ name: “mohit”, age: “24″ },
function(data){
alert(“Ajax call complete”);
}
);
2. $.post() : Load a remote page using an HTTP POST request.
Syntax: $.post(String url, Map params, Function callback) returns XMLHttpRequest
Example 1: simple ajax call using $.post()
$.post(“test.php”);
Example 2: ajax call with parameter
$.post(“test.php”, { name: “mohit”, age: “24″ } );
Example 3: ajax call handles response
$.post(“test.php”, function(data){
alert(“Ajax call complete”);
});
Example 4: ajax call with parameter and handles response
$.post(“test.php”,
{ name: “mohit”, age: “24″ },
function(data){
alert(“Ajax call complete”);
}
);
Isn’t it simple to use JQuery for AJAX…
Posted in Technical | Tagged ajax, get, javascript, jquery, post | 5 Comments »
Vidhya: hey! what is the matter you have called up all of a sudden?Nithya : do u remember that my parents gave my horoscope, to search for a suitable match, to many people? So many horoscopes of the groom has come.. in that 4-5 seems to match.. I don’t know which one to select, I am confused because of it.
Vidhya: what is the confusion about?
Nithya: horoscopes of many software engineers have come. It seems now a days, the software guys are wanting to marry girls in the other field. That’s I why I don’t know whom I must select among this. You are a software engineer na pls give me some suggestion .
vidhya: not a problem at all. So tell me the position that each one holds.
nithya: first is a manager.
vidhya: manager?? Then he will showcast himself that he is busy always. But he will not do anything properly. He will get u 1 kg of rice and ask you to prepare for the whole area say a village. He will get you mutton and ask you to prepare chicken 65. Even if you protest telling you can’t make it, he’ll not accept. He will tell you to work hard day and night to prepare it. He will also tell he’ll provide you with the night cab. Even if you ask how can I prepare chicken 65 out of it by sitting day and night he will not accept.
Nithya: ohh..so dangerous he is!! Then I must escape. Next is a tester.
vidhya: he is more dangerous than the other person. Whatever you do he will correctly tell only the fault in it. Even if you try to surprise him with 10 variety of food, he will tell the item which does not have salt in it. If you ask him “will you not at least tell that it is good”, he will reply back saying it is your duty to make it good so why must I tell that. He is sooo good.
Nithya: then a NO to him also. Next is the performance test engineer.
vidhya: he is another specimen.. even if everything is good, he will ask why did it take this much time. If you take 10 minutes to make a coffee, he will question you asking why you have taken 10 min for a coffee which can be done within 5 min. Even if you say that he is talking about the instant coffee while you have made the filter coffee, he will not accept. The same will be with all the work you do. You must not think about this person if you want to do make up in your life !!!
Nithya: then! you mean to say that we should not marry software guys??
Vidhya: who said like that?? In software there is one more group. They are called the developers group. How much ever you hit them they will bear.
Nithya: then tell about them.
Vidhya: you don’t have to do anything. They will do everything themselves. If we sit back and just boost them it is enough. But the problem with them is- they will say “I know it” whatever you ask them. Even that is ok. They will bear how much ever you hit them but the condition is you must keep saying “you are too good” after hitting them every time.
Nithya: this is superb. Then we must search for this kind of a groom….
Posted in Fun, Joke | Tagged Fun, Joke | 3 Comments »
There have been a whole bunch of posts on this blog about the differences in code size between jQuery and Prototype. The basic premise of those posts (which I agree with) is that because of the way jQuery code is structured, all sorts of typical Javascript design patterns are rendered shorter and simpler in the framework when compared with Prototype.
A basic introduction to jQuery and the concepts that you need to know to use it.
<html>
<head>
<script type="text/javascript" src="path/to/jquery.js"></script>
<script type="text/javascript">
// Your code goes here
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>
Edit the src attribute in the script tag to point to your copy of jquery.js.
For example, if jquery.js is in the same directory as your HTML file, you
<script type="text/javascript" src="jquery.js"></script>
Launching Code on Document Ready
The first thing that most Javascript programmers end up doing is adding some code to their program, similar to this:
window.onload = function(){ alert("abc") }
Inside of which is the code that you want to run right when the page
is loaded. Problematically, however, the Javascript code isn’t run
until all images are finished downloading (this includes banner ads).
The reason for using window.onload in the first place is due to the
fact that the HTML ‘document’ isn’t finished loading yet, when you
first try to run your code.
To circumvent both problems, jQuery has a simple statement that checks the document and waits until it’s ready to be manipulated, known as the ready event:
$(document).ready(function(){
// Your code here
});
The remaining jQuery examples will need to be placed inside the ready event so that they are executed when the document is ready to be worked on. Add the next section of code:
$("a").click(fuction(){
palert("Thanksr feor visiting!");
});
Adding a Class
Another common task is adding (or removing) a class. For example:
$("a").addClass("test");
Posted in Technical | Tagged javascript, jquery | Leave a Comment »
I found an interesting behavior with umlaut characters (ö,ü …). When we calculate the length of a string having umlaut characters (using string length function), different language compilers gives the different results.
I did some testing in some programming & scripting languages, and got some interesting results. Have a look
Java 5:
“ü”.length(); //output : 2 (count 2 for umlaut character)
“üö”.length(); //output : 4
“aüö”.length(); //output : 5 (count 1 for simple characters and 2 for umlaut characters)
Javascript (tested on Firefox 2.0, IE6.0):
“ü”.length; //output : 1
“üö”.length; //output : 2
“aüö”.length; //output : 3
VBScript (tested on IE6.0):
Len(“ü”) //output : 1
Len(“üö”) //output : 2
Len(“aüö”) //output : 3
C#.NET (2005):
“ö”.Length; //output : 1
“üö”.Length; //output : 2
“aüö”.Length;//output : 3
VB.NET (2005):
“ö”.Length //output : 1
“üö”.Length //output : 2
“aüö”.Length//output : 3
PHP:
strlen(“ü”); //output : 2 (count 2 for umlaut character)
strlen(“üö”); //output : 4
strlen(“aüö”); //output : 5 (count 1 for simple characters and 2 for umlaut characters)
Turbo C++:
strlen(“ü”); //output : 1
strlen(“üö”); //output : 2
strlen(“aüö”); //output : 3
Your comments and views are invited.
Posted in Technical | Tagged c, c#.net, java, javascript, js, PHP, Umlaut characters, vb.net, vbscript | 2 Comments »