Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

mornlee http://www.neokeen.com/mornlee

« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS 

Digg Del.icio.us DotNetKicks javascript snippets

// description of your code here

<DIV class=diggbutton>
<SCRIPT type=text/javascript>
digg_url = 'http://digg.com/software/IE7_Pain';
</SCRIPT>

<SCRIPT src="http://digg.com/api/diggthis.js" type=text/javascript></SCRIPT>
</DIV>
<p><a  href="http://vaultofthoughts.net/ct.ashx?id=f3f92dc0-810e-45fc-a82e-3d6a761af198&url=http%3a%2f%2fwww.dotnetkicks.com%2fkick%2f%3furl%3dhttp%3a%2f%2fvaultofthoughts.net%2fIE7Pain.aspx""><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://vaultofthoughts.net/IE7Pain.aspx" border="0" alt="kick it on DotNetKicks.com" /></a></p>
		<div>
			<a href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent('http://VaultOfThoughts.net/IE7Pain.aspx')+'&title='+encodeURIComponent('IE7 Pain'), 'delicious','toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/static/img/delicious.small.gif" alt="Add to del.icio.us" border="0" />Add to del.icio.us</a>
		</div>

Cool Effects in Browser

// description of your code here

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

// description of your code here

<SCRIPT LANGUAGE="JavaScript1.1">
<!-- hide from non-scriptable browsers

// JavaScript sees numbers with leading zeros as octal values, so strip zeros
function stripZeros(inputStr) {
	var result = inputStr
	while (result.substring(0,1) == "0") {
		result = result.substring(1,result.length)
	}
	return result
}

// general purpose function to see if an input value has been entered at all
function isEmpty(inputStr) {
	if (inputStr == "" || inputStr == null) {
		return true
	}
	return false
}

// general purpose function to see if a suspected numeric input
// is a positive integer
function isNumber(inputStr) {
	for (var i = 0; i < inputStr.length; i++) {
		var oneChar = inputStr.substring(i, i + 1)
		if (oneChar < "0" || oneChar > "9") {
			return false
		}
	}
	return true
}

// function to determine if value is in acceptable range for this application
function inRange(inputStr) {
	num = parseInt(inputStr)
	if ((num < 0) || (num > 255)) {
		return false
	}
	return true
}

function isValid(inputStr) {
	if (isEmpty(inputStr)) {
		alert("Please enter a number")
		return false
	} else {
		if (!isNumber(inputStr)) {
			alert("Please enter numbers only")
			return false
		} else {
			if (!inRange(inputStr)) {
				alert("Valid range is 0 - 255")
				return false
			}
		}
	}
	return true
}

function allDone(form) {
  var inputStr1 = form.entry1.value
  var inputStr2 = form.entry2.value
  var inputStr3 = form.entry3.value
  var inputStr4 = form.entry4.value

  var doneVal
  var ok2Cont   = true

	if ( isEmpty(inputStr1) || isEmpty(inputStr2) ||
	   isEmpty(inputStr3) || isEmpty(inputStr4) ) {
     ok2Cont = false ;
     alert("All fields need to be filled in")	;
	}

  if (ok2Cont) {
     form.octet1.value = toBin(inputStr1)
     form.octet2.value = toBin(inputStr2)
     form.octet3.value = toBin(inputStr3)
     form.octet4.value = toBin(inputStr4)

     // Concatenate binary characters
     doneVal = toBin(inputStr1) + toBin(inputStr2) + toBin(inputStr3) + toBin(inputStr4) ;

     form.all4.value = doneVal

     // strip any leading zero
     doneVal = stripZeros(doneVal) ;

     // convert binary to decimal
     form.result.value = "HTTP://" + parseInt(doneVal, 2) ;
  } else {
     form.octet1.value = ""
     form.octet2.value = ""
     form.octet3.value = ""
     form.octet4.value = ""
     form.result.value = ""
  }
}


// Decimal to binary, returns an eight character string
function toBin(inVal) {
   base = 2 ;
   num = parseInt(inVal);
   binNum = num.toString(base);
   // pad leading spaces with "0"
   binNum = padTextPrefix(binNum, "0", 8) ;

   return binNum
}

// equiv to padl()
function padTextPrefix (InString, PadChar, DefLength)  {
   if (InString.length >= DefLength)
      return (InString);
   OutString = InString
   for (Count = InString.length; Count < DefLength; Count++)  {
      OutString = PadChar + OutString;
   }
   return (OutString);
}

// end hiding -->
</SCRIPT>

20-GOTO-10 webshell dos javascript

var arrCommandHistory = new Array();
var iCommandHistoryIndex = 0;
var isContactMode = false;
var contactPrompt = '';

function handleKeyPress(keyCode, obj) {
switch(keyCode)
{
case 13:
handleReturn(obj);
break;
case 38:
if(iCommandHistoryIndex > 0) {
iCommandHistoryIndex --;
document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
}
break;
case 40:
if(iCommandHistoryIndex < arrCommandHistory.length) {
if(iCommandHistoryIndex < arrCommandHistory.length-1) {
iCommandHistoryIndex ++;
}
document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
}
break;
default:
document.getElementById('commandContainer').innerHTML = obj.value.replace(/ /g, '&nbsp;');
}
}

function handleReturn(obj) {
arrCommandHistory[arrCommandHistory.length] = obj.value;
iCommandHistoryIndex = arrCommandHistory.length;
var head=document.getElementsByTagName('head').item(0);
var old=document.getElementById('lastScript');
if(old)head.removeChild(old);
script=document.createElement('script');
script.src='RPC-Executer.aspx?command='+obj.value+'&random='+(Math.round((Math.random()*1000)+1));
script.type='text/javascript'; script.defer=true;
script.id='lastScript';
void(head.appendChild(script));
}

function RPCCallback(sHTML) {
sHTML = sHTML.replace(/&lt;/g, '<');
var obj = document.getElementById('entryBox');
var sOutput = '';
if(!isContactMode) {
sOutput += '<div style="padding-bottom:15px;">C:\\> '+obj.value+'
';
setPromptToNormal();
} else {
sOutput += '<div style="padding-bottom:15px;">'+document.getElementById('commandPrompt').innerHTML+'&nbsp;'+obj.value+'
';
document.getElementById('commandPrompt').innerHTML = contactPrompt+': ';
}
sOutput += sHTML;sOutput += '</div>';
document.getElementById('outputContainer').innerHTML += sOutput;
obj.value = '';
document.getElementById('commandContainer').innerHTML = '';
window.scrollBy(0,10000);
}

function RPCCallbackClearScreen() {
document.getElementById('entryBox').value = '';
document.getElementById('outputContainer').innerHTML = '
';
document.getElementById('commandContainer').innerHTML = '';
window.scrollBy(0,-10000);
}

function setPromptToNormal() {
document.getElementById('commandPrompt').innerHTML = 'C:\\>';
}

function popUp(sURL) {
var oWin = window.open(sURL, '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');
if (oWin==null || typeof(oWin)=="undefined") {
alert("It seems that you have a popup blocker enabled. Please disable it and try again.");
}
}

function setFocusToEntryBox() {
var o = document.getElementById('entryBox');
o.focus();
o.value = o.value;
}
« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS