How to disable javascript in Google Chrome
In this article, I will explain more than 3 methods to disable JavaScript in Google Chrome Browser.
In this article, I will explain more than 3 methods to disable JavaScript in Google Chrome Browser.
<script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
data-ad-slot="yyyyyyyyyy"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Error parsing XML, line --, column --: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.
Make Sure your async is followed by the ="async" property. (async="async").
$("elementID").addClass("ClassName")
<script src='//code.jquery.com/jquery-1.8.0.min.js' type='text/javascript'></script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("img").addClass("my-sample-class-for-all-img-tags");
});
</script>
<script type='text/JavaScript'>
var images = document.getElementsByTagName("img");
var i;
for(i = 0; i < images.length; i++) {
images[i].className += " my-sample-class-for-all-img-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("pre").addClass("my-sample-class-for-all-pre-tags");
});
</script>
<script type='text/JavaScript'>
var pres = document.getElementsByTagName("pre");
var i;
for(i = 0; i < pres.length; i++) {
pres[i].className += " my-sample-class-for-all-pre-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("code").addClass("my-sample-class-for-all-code-tags");
});
</script>
<script type='text/JavaScript'>
var codes = document.getElementsByTagName("code");
var i;
for(i = 0; i < codes.length; i++) {
codes[i].className += " my-sample-class-for-all-code-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("div").addClass("my-sample-class-for-all-div-tags");
});
</script>
<script type='text/JavaScript'>
var divs = document.getElementsByTagName("div");
var i;
for(i = 0; i < divs.length; i++) {
divs[i].className += " my-sample-class-for-all-div-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("button").addClass("my-sample-class-for-all-button-tags");
});
</script>
<script type='text/JavaScript'>
var buttons = document.getElementsByTagName("button");
var i;
for(i = 0; i < buttons.length; i++) {
buttons[i].className += " my-sample-class-for-all-button-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("input").addClass("my-sample-class-for-all-input-tags");
});
</script>
<script type='text/JavaScript'>
var inputs = document.getElementsByTagName("input");
var i;
for(i = 0; i < inputs.length; i++) {
inputs[i].className += " my-sample-class-for-all-input-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("textarea").addClass("my-sample-class-for-all-textarea-tags");
});
</script>
<script type='text/JavaScript'>
var textareas = document.getElementsByTagName("textarea");
var i;
for(i = 0; i < textareas.length; i++) {
textareas[i].className += " my-sample-class-for-all-textarea-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("span").addClass("my-sample-class-for-all-span-tags");
});
</script>
<script type='text/JavaScript'>
var spans = document.getElementsByTagName("span");
var i;
for(i = 0; i < spans.length; i++) {
spans[i].className += " my-sample-class-for-all-span-tags";
}
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("html").addClass("my-sample-class-for-html-tag");
});
</script>
<script type='text/JavaScript'>
var htmltag = document.getElementsByTagName("html");
htmltag[0].className += " my-sample-class-for-html-tag";
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$("body").addClass("my-sample-class-for-body-tag");
});
</script>
<script type='text/JavaScript'>
var bodytag = document.getElementsByTagName("body");
bodytag[0].className += " my-sample-class-for-body-tag";
</script>
<script type='text/JavaScript'>
jQuery('document').ready(function(){
$(".existing-class-name").addClass("my-sample-class-for-element-with-a-class-of-existing-class-name");
});
</script>
<script type='text/JavaScript'>
var classes = document.getElementsByClassName("existing-class-name-to-find");
var i;
for(i = 0; i < classes.length; i++) {
classes[i].className += " my-sample-class-for-all-elements-with-class-of-existing-class-name-to-find";
}
</script>
window.open(URL,name,Attributes) ;
Where URL is your specified URL to open, name is the title or name for the tab,attributes are the optional attributes we can use.
<form>
<input type="button" value="New Window!" onClick="window.open('http://www.google.com','google','width=640,height=460')"/>
</form>
window.open('', '_blank', 'toolbar=0,location=0,menubar=0');
<script type="text/javascript">
function open_new_window(URL)
{
NewWindow=window.open(URL,"_blank","toolbar=no,menubar=0,status=0,copyhistory=0,scrollbars=yes,resizable=1,location=0,Width=1500,Height=760") ;
NewWindow.location = URL;
}
</script>
<a href="#" onClick="open_new_window('http://www.google.com');">google search</a>
<a href="#" onClick="open_new_window('http://www.yahoo.com');">yahoo search</a>
Set position of new window
<form>
<input type="button" value="New Window!" onClick="window.open('http://google.com','google search','width=700,height=600,left=0,top=100,screenX=0,screenY=100')">
</form>
<form>
<input type="button" value="Close Window" onClick="window.close()">
</form>
<script type="text/javascript">
var stopafter = 0;
var firestop = [];
var fire = [];
var stdDOM = document.getElementById;
var nsDOM = ((navigator.appName.indexOf('Netscape') != -1) && (parseInt(navigator.appVersion) ==4)); function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:700;}function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:500;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;} function posTop() {return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;} var hD="0123456789ABCDEF"; function d2h(d) {return hD.substr(d>>>4,1)+hD.substr(d&15,1);} layernum=0; piece = function(parent) {this.elem = null; if(nsDOM) {if(parent == null) this.elem=new Layer(1); else {this.elem=new Layer(1,parent.elem); this.style.visibility = "inherit";} this.parent = parent; this.style = this.elem;} else if (stdDOM) {if(parent == null) this.parent=document.body; else this.parent=parent.elem; this.elem = document.createElement('div'); var xName = "xLayer" + layernum++; this.elem.setAttribute('id', xName); elemc = document.createTextNode('.'); this.elem.appendChild(elemc); this.parent.appendChild(this.elem); this.style = this.elem.style;document.getElementById(xName).style.lineHeight = '3px'; document.getElementById(xName).style.color = '#fff'; document.getElementById(xName).style.position = 'absolute';} window[this.elem.id]=this; this.ay = .1; this.type = 0;}; piece.prototype.moveTo = function(x,y) {if(nsDOM) this.elem.moveTo(x,y); else {this.style.left = x+"px"; this.style.top = y+"px";}}; piece.prototype.setC = function(colour) {if(nsDOM) this.elem.bgColor = colour; else this.style.backgroundColor = colour==null?'transparent':colour; }; piece.prototype.fire = function(sx, sy, fw) {var a = Math.random() * Math.PI * 2; switch (fw) {case 1: var s = Math.random() * 2; break; case 2: var s = 2; break; case 3: var s = (Math.PI * 2) - a - Math.random(); break; case 4: var s = a - Math.random(); break; default: var s = Math.random() * 2; if(Math.random() >.6) s = 1.5;} this.dx = s*Math.sin(a); this.dy = s*Math.cos(a) - 2; this.x = sx; this.y = sy; this.moveTo(sx, sy);}; piece.prototype.sCol = function(hex,hex2,cl) {switch (cl) {case 1: this.setC("#" + hex + hex2 + "00"); break; case 2: this.setC("#00" + hex + "00"); break; case 3: this.setC("#00" + hex + hex2); break; case 4: this.setC("#" + hex + "0000"); break; case 5: this.setC("#" + hex + hex + "00"); break; case 6: this.setC("#" + hex + hex + hex); break; case 7: this.setC("#" + hex2 + hex + "00"); break; default: this.setC("#" + hex + hex2 + hex);}}; piece.prototype.animate = function(step,cl) {var colour = (step > 25) ? Math.random()*(380-(step*5)) : 255-(step*4); var hex = d2h(colour-112); if (colour < 112) hex = d2h(colour); this.sCol(d2h(colour),hex,cl); this.dy += this.ay; this.x += this.dx; this.y += this.dy; this.moveTo(this.x, this.y);}; fo = function(numst) {this.id = "fo"+fo.count++;this.sp = new Array(); for(i=0 ; i<numst; i++) {this.sp[i]=new piece(); if(nsDOM){this.sp[i].style.clip.top =0; this.sp[i].style.clip.left = 0; this.sp[i].style.clip.bottom = 3; this.sp[i].style.clip.right = 3;} else this.sp[i].style.clip="rect("+0+" "+3+" "+3+" "+0+")"; this.sp[i].style.visibility = "visible";} this.step = 0; window[this.id]=this; fire.push(this); firestop.push(setInterval("window."+this.id+".animate()", 15));}; fo.count = 0; fo.prototype.animate = function() {if(this.step > 55) this.step = 0; if(this.step == 0) {var x = posLeft() + 50 + (Math.random()*(pageWidth() - 200)); var y = posTop() + 50 + (Math.random()*(pageHeight() - 250)); var fw = Math.floor(Math.random() * 5); this.cl = Math.floor(Math.random() * 8); for(i=0 ; i<this.sp.length ; i++)this.sp[i].fire(x, y, fw);} this.step++; for(i=0 ; i<this.sp.length ; i++) this.sp[i].animate(this.step,this.cl);};
function stopfire() {for(var i = firestop.length - 1; i >= 0; i--) {clearInterval(firestop[i]); for (var j = fire[i].sp.length - 1; j >= 0; j--) {fire[i].sp[j].style.visibility = "hidden";}}}
function fireworks() {new fo(50);setTimeout('new fo(50)',750);if (stopafter > 0) {setTimeout('stopfire()',stopafter * 60000);}} window.onload=fireworks;
</script>
<script type="text/javascript">
// <![CDATA[
var bits=80; // how many bits
var speed=33; // how fast - smaller is faster
var bangs=5; // how many can be launched simultaneously (note that using too many can slow the script down)
var colours=new Array("#03f", "#f03", "#0e0", "#93f", "#0cf", "#f93", "#f0c");
// blue red green purple cyan orange pink
/****************************
* Fireworks Effect *
http://aslamise.blogspot.com
****************************/
var bangheight=new Array();
var intensity=new Array();
var colour=new Array();
var Xpos=new Array();
var Ypos=new Array();
var dX=new Array();
var dY=new Array();
var stars=new Array();
var decay=new Array();
var swide=800;
var shigh=600;
var boddie;
window.onload=function() { if (document.getElementById) {
var i;
boddie=document.createElement("div");
boddie.style.position="fixed";
boddie.style.top="0px";
boddie.style.left="0px";
boddie.style.overflow="visible";
boddie.style.width="1px";
boddie.style.height="1px";
boddie.style.backgroundColor="transparent";
document.body.appendChild(boddie);
set_width();
for (i=0; i<bangs; i++) {
write_fire(i);
launch(i);
setInterval('stepthrough('+i+')', speed);
}
}}
function write_fire(N) {
var i, rlef, rdow;
stars[N+'r']=createDiv('|', 12);
boddie.appendChild(stars[N+'r']);
for (i=bits*N; i<bits+bits*N; i++) {
stars[i]=createDiv('*', 13);
boddie.appendChild(stars[i]);
}
}
function createDiv(char, size) {
var div=document.createElement("div");
div.style.font=size+"px monospace";
div.style.position="absolute";
div.style.backgroundColor="transparent";
div.appendChild(document.createTextNode(char));
return (div);
}
function launch(N) {
colour[N]=Math.floor(Math.random()*colours.length);
Xpos[N+"r"]=swide*0.5;
Ypos[N+"r"]=shigh-5;
bangheight[N]=Math.round((0.5+Math.random())*shigh*0.4);
dX[N+"r"]=(Math.random()-0.5)*swide/bangheight[N];
if (dX[N+"r"]>1.25) stars[N+"r"].firstChild.nodeValue="/";
else if (dX[N+"r"]<-1.25) stars[N+"r"].firstChild.nodeValue="\\";
else stars[N+"r"].firstChild.nodeValue="|";
stars[N+"r"].style.color=colours[colour[N]];
}
function bang(N) {
var i, Z, A=0;
for (i=bits*N; i<bits+bits*N; i++) {
Z=stars[i].style;
Z.left=Xpos[i]+"px";
Z.top=Ypos[i]+"px";
if (decay[i]) decay[i]--;
else A++;
if (decay[i]==15) Z.fontSize="7px";
else if (decay[i]==7) Z.fontSize="2px";
else if (decay[i]==1) Z.visibility="hidden";
Xpos[i]+=dX[i];
Ypos[i]+=(dY[i]+=1.25/intensity[N]);
}
if (A!=bits) setTimeout("bang("+N+")", speed);
}
function stepthrough(N) {
var i, M, Z;
var oldx=Xpos[N+"r"];
var oldy=Ypos[N+"r"];
Xpos[N+"r"]+=dX[N+"r"];
Ypos[N+"r"]-=4;
if (Ypos[N+"r"]<bangheight[N]) {
M=Math.floor(Math.random()*3*colours.length);
intensity[N]=5+Math.random()*4;
for (i=N*bits; i<bits+bits*N; i++) {
Xpos[i]=Xpos[N+"r"];
Ypos[i]=Ypos[N+"r"];
dY[i]=(Math.random()-0.5)*intensity[N];
dX[i]=(Math.random()-0.5)*(intensity[N]-Math.abs(dY[i]))*1.25;
decay[i]=16+Math.floor(Math.random()*16);
Z=stars[i];
if (M<colours.length) Z.style.color=colours[i%2?colour[N]:M];
else if (M<2*colours.length) Z.style.color=colours[colour[N]];
else Z.style.color=colours[i%colours.length];
Z.style.fontSize="13px";
Z.style.visibility="visible";
}
bang(N);
launch(N);
}
stars[N+"r"].style.left=oldx+"px";
stars[N+"r"].style.top=oldy+"px";
}
window.onresize=set_width;
function set_width() {
var sw_min=999999;
var sh_min=999999;
if (document.documentElement && document.documentElement.clientWidth) {
if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth;
if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight;
}
if (typeof(self.innerWidth)!="undefined" && self.innerWidth) {
if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth;
if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight;
}
if (document.body.clientWidth) {
if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth;
if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight;
}
if (sw_min==999999 || sh_min==999999) {
sw_min=800;
sh_min=600;
}
swide=sw_min;
shigh=sh_min;
}
// ]]>
</script>
<a class="darken" href="http://google.com/" style="background: black; display: inline-block; padding: 0;">
<img alt="Mouse Over and Opacity Will Change with inline CSS and JavaScript" onmouseout="this.style.opacity=1;" onmouseover="this.style.opacity=0.6;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEify_lGIWF48wrBM8WqYvkJ4qJhmR12TWFEkOEE_Rlusa0UdOlyR1jJjKmROn0G4HGjVRXc3FIXw4A7PFgy-52ix-cf8yIWYCFxzFfgjeVfDF8HoTXUfIzyi2Qq2p2qv-1Xmw2bd8Hr8I0z/s1600/darkenimage.jpg" style="display: block;" width="200" />
</a>
<style>
a.darkencss {
display: inline-block;
background: black;
padding: 0;
}
a.darkencss img {
display: block;
-webkit-transition: all 0.5s linear;
-moz-transition: all 0.5s linear;
-ms-transition: all 0.5s linear;
-o-transition: all 0.5s linear;
transition: all 0.5s linear;
}
a.darkencss:hover img {
opacity: 0.7;
}
</style>
<a class="darkencss" href="http://google.com/">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEify_lGIWF48wrBM8WqYvkJ4qJhmR12TWFEkOEE_Rlusa0UdOlyR1jJjKmROn0G4HGjVRXc3FIXw4A7PFgy-52ix-cf8yIWYCFxzFfgjeVfDF8HoTXUfIzyi2Qq2p2qv-1Xmw2bd8Hr8I0z/s1600/darkenimage.jpg" width="200" />
</a>
Effect with jquery JavaScript.(Works in all commom browsers)
<style>
a.darkenjquery {
display: inline-block;
background: black;
padding: 0;
}
a.darkenjquery img {
display: block;
}
</style>>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<a class="darkenjquery" href="http://google.com/">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEify_lGIWF48wrBM8WqYvkJ4qJhmR12TWFEkOEE_Rlusa0UdOlyR1jJjKmROn0G4HGjVRXc3FIXw4A7PFgy-52ix-cf8yIWYCFxzFfgjeVfDF8HoTXUfIzyi2Qq2p2qv-1Xmw2bd8Hr8I0z/s1600/darkenimage.jpg" width="200" />
</a>
<script>
$('.darkenjquery').hover(function() {
$(this).find('img').fadeTo(500, 0.5);
}, function() {
$(this).find('img').fadeTo(500, 1);
});
</script>
<?php
$redirecturl='http://aslamise.blogspot.com';
echo "<script type='text/javascript'>window.open('$redirecturl', '_parent', '')</script>";
?>
<?php
$redirecturl='http://aslamise.blogspot.com'; //Assigning the redirect url
echo "
<script type='text/javascript'>
window.open('$redirecturl', '_parent', '')//Window.open = Opening the window in the specified address
$redirecturl= The Url we assigned just before.
_parent =opening on the main.even if the script goes inside iframe-
It will be opened in main window and not inside iframe.
</script>
";
?>
<head></head> tags.
<script type='text/javascript'>
var begcolor='#0084d8'; // STARTING COLOR AS A HEX STRING
var endcolor='#c4c4c4'; // ENDING COLOR AS A HEX STRING
var steps=50; // TOTAL CHANGE STEPS FROM ONE COLOR TO THE OTHER
var delay=50; // DELAY BETWEEN EACH COLOR CHANGE. LOWER IS FASTER.
//*** DO NOT EDIT BEYOND THIS POINT ***\\
var data=new Array();
var ns4=(document.layers)?true:false;
for(i=1, j=1;i<=3; i++, j+=2)data[i]=new colorset(j);
document.bgColor=begcolor;
function colorset(num){
this.beg=parseInt('0x'+begcolor.substring(num,num+2));
this.end=parseInt('0x'+endcolor.substring(num,num+2));
this.up=this.startup=(this.end>=this.beg)? true : false;
this.incr=Math.abs(this.end-this.beg)/steps;
this.current=this.beg;
}
function changebg(){
var color=new Array();
for(i=1;i<=3; i++){
(data[i].up)? data[i].current+=data[i].incr : data[i].current-=data[i].incr;
if(data[i].startup){
if(data[i].current>=data[i].end){ data[i].up=false; data[i].current=data[i].end}
if(data[i].current<=data[i].beg){ data[i].up=true; data[i].current=data[i].beg }
}
if(!data[i].startup){
if(data[i].current<=data[i].end){ data[i].up=true; data[i].current=data[i].end}
if(data[i].current>=data[i].beg){ data[i].up=false; data[i].current=data[i].beg}
}
color[i]=data[i].current;
}
color[4]=Math.floor(color[1]).toString(16); if(color[4].length==1)color[4]='0'+color[4];
color[5]=Math.floor(color[2]).toString(16); if(color[5].length==1)color[5]='0'+color[5];
color[6]=Math.floor(color[3]).toString(16); if(color[6].length==1)color[6]='0'+color[6];
document.bgColor='#'+color[4]+color[5]+color[6];
}
window.onload=function(){
setInterval('changebg()',delay);
}
</script>
setInterval('changebg()',delay);
TO
if(!ns4)setInterval('changebg()',delay);
<head>
<script src='./javascript/draggable.js' type='text/javascript'>
</script>
</head>
<script type='text/javascript'>
new dragElement(ELEMENT ID);
</script>
#MyDiv{
position:absolute;
}
#MyDiv{
position:fixed;
}
<script type='text/javascript'>
new dragElement(MyDiv);
</script>
<script type='text/javascript'>
new dragElement(MyDiv);
new dragElement(MyDiv2);
</script>
<style type='text/css'>
*{
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
transition: all 0.2s ease;
}
</style
The above css code will make all transitions on the page smoother than before.
<style type='text/css'>
#MyDiv,#MyDiv2 {
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
transition: all 0.2s ease;
}
</style>
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px"}R++}tag=setInterval('A()',5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position="static";}}; void(0)
javascript:
R=0; //Assigning Variables and starting values.
x1=.1;
y1=.05;
x2=.25;
y2=.24;
x3=1.6;
y3=.24;
x4=300;
y4=200;
x5=300;
y5=200;//
var DI= document.getElementsByTagName("img"); // getting all img id's from our document .it will collect all img tags.
DIL=DI.length; //Storing the total number of images to variable DIL.
function A() // Declaring a function
{
for(i=0; i<DIL; i++) //loop while the looping of process end .
{
DIS=DI[ i ].style; //getting the style of each img tag
DIS.position='absolute'; //changing the position of images to absolute
DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; //Assigning Left position value to image.
DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px" //Assigning top position value of images.
}
R++ //after each loop , incresing the value of r + 1.
}
tag=setInterval('A()',5 );
document.onmousedown=function() // Clearing the values and return to static position when we right click on page.
{
clearInterval(tag);
for(i=0; i<DIL; i++){DI[i].style.position="static";
}
};
void(0)
javascript:R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24;x4=300;y4=200;x5=300;y5=200;DI= document.images;DIL=DI.length;function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style;DIS.position='absolute' ;DIS.left=Math.sin(R*x1+ i*x2+x3)* x4+x5;DIS.top=Math.cos(R*y1+ i*y2+y3)* y4+y5;} R++;}setInterval('A()',5);void(0);
javascript:(function() { var s,F,j,f,i; s = ""; F = document.forms; for(j=0;j<F.length;++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords on this page:\n\n" + s); else alert("No passwords in on this page."); })();
javascript:(function() //Declaring a javascript Function { var s,F,j,f,i; //Declaring Vriables to store data. s = ""; //Assigning a 0 value for variable s to avoid problems when execute F = document.forms; // Declaring F as Forms in our Page (Forms contains passwords to be submitted) for(j=0;j<F.length;++j) // looping between current forms in our page { f = F[j]; /Assigning f as current form while processing for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; //checking whether element type is password (Where we declare input type='password' ).if there is , storing the password value to variable s. } } if (s) alert("Passwords on this page:\n\n" + s);//giving an alert message that contains the password. else alert("No passwords in on this page.");//if the looping is over and couldnt find any forms with passwords, displays an alert message with No password on this page })();
Bold | [b]text[/b] |
Italic | [i]text[/i] |
Url | [url]link[/url] |
Inline Code | [code]text[/code] |
Block Code | [pre]text[/pre] |
Image | [img]link[/img] |