Archive

Archive for the ‘Technology’ Category

HOw to add or remove javascript event dynamically

April 30, 2009 Leave a comment

ElementId.EventName returns the corresponding event handing code.
The following code dynamically remove onmouseover event from td element & can add the event of the fly.

var event;
function over(){
alert(‘over’);
alert(document.getElementById(‘tid’) );
event = document.getElementById(‘tid’).onmouseover;
document.getElementById(‘tid’).onmouseover = null;
}
function out(){
alert(‘out’);
//document.getElementById(‘tid’).onmouseover = event;

}

add/remove js event dynamically
Categories: javascript

using typeof operator to gurantee the value of a variable

April 21, 2009 Leave a comment

It checks whether a variable has been set.
I got it from somewhere else.

if (!(typeof worldHasEnded == “undefined”)) {
document.write(“YUP.”);
} else {
document.write(“NOPE.”);
}

dynamically adding element with html page

1.
2.
3. Dynamically add Textbox, Radio, Button in html Form using JavaScript
4.
5. function add(type) {
6.
7. //Create an input type dynamically.
8. var element = document.createElement(“input”);
9.
10. //Assign different attributes to the element.
11. element.setAttribute(“type”, type);
12. element.setAttribute(“value”, type);
13. element.setAttribute(“name”, type);
14.
15. var foo = document.getElementById(“fooBar”);
16.
17. //Append the element in page (in span).
18. foo.appendChild(element);
19.
20. }
21.
22.
23.
24.
25.

Dynamically add element in form.


26. Select the element and hit Add to add it in form.
27.

28.
29. Button
30. Textbox
31. Radio
32.
33.
34.
35.
36.  
37.
38.
39.
40.

original link:http://viralpatel.net/blogs/2009/01/dynamic-add-textbox-input-button-radio-element-html-javascript.html

Categories: javascript

Recursive Find & Replace

January 5, 2009 Leave a comment

grep -rl string1 dirname | xargs sed -i ‘s/string1/string2/’

this command just replace string1 in all file (nested or not ) in directory dirname with string2. I think it may be helpful to replace the cvs id of one user with cvs id of another.

For example i used this command to replace all occurence of hasan_rakibul into prosunjit_biswas

grep -rl hasan_rakibul ObjRunSrv/ | xargs sed -i ‘s/hasan_rakibul/prosunjit_biswas/’

Categories: Technology

Google Funs

November 28, 2008 Leave a comment

Some options i really liked when I started searching expedient google lineaments. Now i will cite some of these.

Time:

Suppose you like to know what is the time in Tokyo(japan) now. TO find this your search string in google will be like
time toyko

So, this way you will get the time of any recognized city of the world.

Unit conversion:
This is also another ripe feature of google.
If you want to convert 5 yard to inches the your search query in google will be like
5 yard in inch

Categories: Technology Tags:

Google Alert – To keep you update

November 24, 2008 1 comment

Google alert is really a very nice utility provided by google as google utility.

If one likes to be apprised about latestĀ  news/information of a query (s)he can set a google alert which will send him alert mail everytime any new entry of that query is added to the google search engine.

To access Google alert urlĀ  is : www.google.com/alerts.
Google alert

I really dote the google alert.

Follow

Get every new post delivered to your Inbox.