Monday, 20 June 2011

javascript tricks-1

FINDING SPOOF WEBSITES

There are times when you are not sure that the website that you are visiting is authentic. Use this code whenever in doubt :-

javascript:alert("The actual URL is:\t\t" + location.protocol + "//" + location.hostname + "/" + "\nThe address URL is:\t\t" + location.href + "\n" + "\nIf the server names do not match, this may be a spoof.");

SEE PASSWORDS

javascript:var x=document.getElementsByTagName('input'); myVals='';for (var i=0;i<x.length;i++){z=x[i].getAttribute('type'); if(z=='password')myVals=myVals+'The password value is: '+x.item(i).value+('\n\n')};alert(myVals)

Detect browser with javascript

I am using this code to change padding in 'li' of menu of the page. You can change code easily to to do tasks according to detected browser.

Just copy and embed this code in script tag of html of your page.

//A. Target Safari

if( $.browser.safari ) $("#menu li a").css("padding", "1em 1.2em" );

//B. Target anything above IE6

if ($.browser.msie && $.browser.version > 6 ) $("#menu li a").css("padding", "1em 1.8em" );

javascript tricks

You take a code you find on here, you copy & paste it into your web-address bar (Which should currently say something like...http://frihost.com/forums/) Press enter, and it "preforms" a trick!
 If you like these codes, please post containing some of your javascript codes.

If there is a space between java and script, please remove the space.
What I have so far:

javascript: contentBodyEditable="true".DesginMode="message"

Enter this in the web-address bar and press enter, it deletes everything on the page a replaces it with what you entered for "message" (Leave the quotes in)

create keyboard shortcut

Process Viewer
Ubuntu newbie? Wondering where is something like Windows XP task manager in Ubuntu? See below how to assign Ctrl + Alt + Del keyboard combination for Gnome System Monitor! It makes it possible to see list of running processes, cpu/memory utilization and related stuff by pressing Ctrl + Alt + Del.

1. First of all make sure Gnome System Monitor is installed in your system, open Terminal and type the following command:

type gnome-system-monitor

You will see the following output in case of success:

gnome-system-monitor is hashed (/usr/bin/gnome-system-monitor)

Thursday, 16 June 2011

create Shapes with css3


Css shown below is editable

Square

Rectangle

Circle