PDA

View Full Version : Ai thích dùng Scripts thì vào đây!!!


LSB-Mèo Đen
03-12-2003, 20:10
sau đây là một số con Scripts tui đã sưu tầm ở trong một số trang Web và tổng hợp lại cho bà con coi tui sẽ để từng bài viết một cho dễ đọc nhé:
<a href="ymsgr:sendIM?w1nd0ws_Xp&m=Hello Nick" target="_blank" name="IM me" onMouseOver="window.status='IM me'; return true;" onMouseOut="window.status=''; return true;">IM me</a>

LSB-Mèo Đen
03-12-2003, 20:13
<a href="ymsgr:sendIM?w1nd0ws_Xp&m=Hello Nick" target="_blank" name="IM me" onMouseOver="window.status='IM me'; return true;" onMouseOut="window.status=''; return true;"><IMG alt="Yahoo! Status (online/Offline)" src="http://opi.yahoo.com/online?u=w1nd0ws_xp&m=g&t=0" border="0"></a>

LSB-Mèo Đen
03-12-2003, 20:15
<TEXTAREA name=txtarea rows=10 cols=46>
cái này do ngắn quá cho nên tui viết thêm mấy dòng này cho đủ 150 kí tự, mong mấy vị quản lí thông cảm dùm.

LSB-Mèo Đen
03-12-2003, 20:16
<!-- TWO STEPS TO INSTALL HEADLINER:

1. Add the onLoad event handler to the BODY tag
2. Copy the specified code into the BODY of your HTML document -->

<!-- STEP ONE: Add this onLoad event handler to the BODY tag -->


<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

//-->
</script>

<body onLoad="StartHeadliner()">

<!-- STEP TWO: Put this code into the BODY of your HTML document -->

<SCRIPT LANGUAGE="JavaScript">



<!-- Original: Jan Pijnacker <[email protected]> -->

<!-- Begin
typeWriterWait=120 // Typewriter delay
blinkTextWait=1000 // Blinking delay
blinkSpacesWait=300 // Blinking 'blank-spaces' delay
blinkMax=3 // how many times to blink
expandWait=100 // expanding headliner delay
scrollWait=90 // scrolling headliner delay
scrollWidth=34 // characters in scroll display
randomLines=false // randomly choose lines? (true or false)
lineMax=7 // how many lines you have
lines=new Array(lineMax)

// Use this format for all the lines below:
// (display text, url or mailto, frame name, effect, delay time)

lines[1]=new Line("The JavaScript Headliner!", "http://www.piaster.nl/perspicacity/js/headliner", "", Blink, 500)
lines[2]=new Line("This is a great JavaScript example - appropriately named ' The JavaScript Headliner ' !", "", "", Scroll, 1000)
lines[3]=new Line("Wouldn't this be good on your site?", "", "", Static, 3500)
lines[4]=new Line("Many ways to present information....", "", "", Expand, 2000)
lines[5]=new Line("Each message can even take the visitor to different a URL when clicked !", "", "", Scroll, 3000)
lines[6]=new Line("Click now to email the author", "mailto:[email protected]?subject=The Headliner", "", TypeWriter, 1500)
lines[7]=new Line("Or here to go back to Messages", "http://messages.javascriptsource.com", "", Static, 3500)
// Don't change these variables below :-)
lineText=""
timerID=null
timerRunning=false
spaces=""
charNo=0
charMax=0
charMiddle=0
lineNo=0
lineWait=0
function Line(text, url, frame, type, wait) {
this.text=text
this.url=url
this.frame=frame
this.Display=type
this.wait=wait
}
function StringFill(c, n) {
var s=""
while (--n >= 0) {
s+=c
}
return s
}
function getNewRandomInteger(oldnumber, max) {
var n=Math.floor(Math.random() * (max - 1) + 1)
if (n >= oldnumber) {
n++
}
return n
}
function getRandomInteger(max) {
var n=Math.floor(Math.random() * max + 1)
return n
}
function GotoUrl(url, frame) {
if (frame != '') {
if (frame == 'self') self.location.href=url
else if (frame == 'parent') parent.location.href=url
else if (frame == 'top') top.location.href=url
else {
s=eval(top.frames[frame])
if (s != null) top.eval(frame).location.href=url
else window.open(url, frame, "toolbar=yes,status=yes,scrollbars=yes")
}
}
else window.location.href=url
}
function Static() {
document.formDisplay.buttonFace.value=this.text
timerID=setTimeout("ShowNextLine()", this.wait)
}
function TypeWriter() {
lineText=this.text
lineWait=this.wait
charMax=lineText.length
spaces=StringFill(" ", charMax)
TextTypeWriter()
}
function TextTypeWriter() {
if (charNo <= charMax) {
document.formDisplay.buttonFace.value=lineText.sub string(0, charNo)+spaces.substring(0, charMax-charNo)
charNo++
timerID=setTimeout("TextTypeWriter()", typeWriterWait)
}
else {
charNo=0
timerID=setTimeout("ShowNextLine()", lineWait)
}
}
function Blink() {
lineText=this.text
charMax=lineText.length
spaces=StringFill(" ", charMax)
lineWait=this.wait
TextBlink()
}
function TextBlink() {
if (charNo <= blinkMax * 2) {
if ((charNo % 2) == 1) {
document.formDisplay.buttonFace.value=lineText
blinkWait=blinkTextWait
}
else {
document.formDisplay.buttonFace.value=spaces
blinkWait=blinkSpacesWait
}
charNo++
timerID=setTimeout("TextBlink()", blinkWait)
}
else {
charNo=0
timerID=setTimeout("ShowNextLine()", lineWait)
}
}
function Expand() {
lineText=this.text
charMax=lineText.length
charMiddle=Math.round(charMax / 2)
lineWait=this.wait
TextExpand()
}
function TextExpand() {
if (charNo <= charMiddle) {
document.formDisplay.buttonFace.value=lineText.sub string(charMiddle - charNo, charMiddle + charNo)
charNo++
timerID=setTimeout("TextExpand()", expandWait)
}
else {
charNo=0
timerID=setTimeout("ShowNextLine()", lineWait)
}
}
function Scroll() {
spaces=StringFill(" ", scrollWidth)
lineText=spaces+this.text
charMax=lineText.length
lineText+=spaces
lineWait=this.wait
TextScroll()
}
function TextScroll() {
if (charNo <= charMax) {
document.formDisplay.buttonFace.value=lineText.sub string(charNo, scrollWidth+charNo)
charNo++
timerID=setTimeout("TextScroll()", scrollWait)
}
else {
charNo=0
timerID=setTimeout("ShowNextLine()", lineWait)
}
}
function StartHeadliner() {
StopHeadliner()
timerID=setTimeout("ShowNextLine()", 2000)
timerRunning=true
}
function StopHeadliner() {
if (timerRunning) {
clearTimeout(timerID)
timerRunning=false
}
}
function ShowNextLine() {
if (randomLines) lineNo=getNewRandomInteger(lineNo, lineMax)
else (lineNo < lineMax) ? lineNo++ : lineNo=1
lines[lineNo].Display()
}
function LineClick(lineNo) {
document.formDisplay.buttonFace.blur()
if (lineNo > 0) GotoUrl(lines[lineNo].url, lines[lineNo].frame)
}
with (document) {
write('<center><form name="formDisplay"><input type="button"')
write('name="buttonFace" value="The JavaScript Source presents...."')
write('onClick="LineClick(lineNo)"></input></form></center>')
}
// End -->
</SCRIPT>

<p><center>

</center><p>

<!-- Script Size: 5.69 KB -->

LSB-Mèo Đen
03-12-2003, 20:18
</style>
<SCRIPT language=JavaScript>
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("No right clicking!!!!!! don't do it again..");
times++ } }
function bye() {
alert("I said NO right clicking! click ok to exit LMAO!");
bye() }
</SCRIPT>

LSB-Mèo Đen
03-12-2003, 20:19
]<SCRIPT LANGUAGE="JavaScript">
<!--
function warn() {
if (event.button==2) {
alert(' Make ur own damn site!')
}
}
document.onmousedown = warn
// -->
</SCRIPT>

LSB-Mèo Đen
03-12-2003, 20:20
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>

<center>
<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Go to...

<!-- Option 1 -- To have the pull down menu go to your own pages, change the URL within the quotation marks and the link name. -->
<!-- Option 2 -- You may remove or add entire lines to increase or decrease the number of links. -->
<option value="url here">link here
<option value="url here">link here
<option value="url here">link here
<option value="url here">link here
<option value="url here">link here

</select>
</form>
</center>

LSB-Mèo Đen
03-12-2003, 20:23
<SCRIPT language=JavaScript>





<!-- Begin

datetoday = new Date();

timenow=datetoday.getTime();

datetoday.setTime(timenow);

thehour = datetoday.getHours();

if (thehour > 18) display = "Evening";

else if (thehour >12) display = "Afternoon";

else display = "Morning";

var greeting = ("Good " + display + "!");

document.write(greeting);

// End -->





</SCRIPT>

LSB-Mèo Đen
03-12-2003, 20:25
<!-- TWO STEPS TO INSTALL E-MAIL LINK:

1. Copy the coding into the BODY of your HTML document
2. Add the last code into a document called "EmailLink.js" -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<div align="center">
<script language="JavaScript" src="EmailLink.js">
<!-- Original: Happy Smart -->
<!-- Web Site: http://happysmart.net -->
</script>
</div>

<p><center>

</center><p>

<!-- Script Size: 0.89 KB -->


<!-- STEP TWO: Paste this code into a document called "EmailLink.js" -->
<!-- Put it in the same directory as the HTML document with the above code -->

function EmailLink(){
window.location = "mailto:"+"?subject=I thought this link might interest you." + "&body="+document.title+" "+window.location;
}
document.write('<INPUT class="select" TYPE="button" VALUE="E-mail this link to a friend" onClick="EmailLink()"></FORM>')

LSB-Mèo Đen
03-12-2003, 20:37
<Script Language="JavaScript1.2">
<!--
top.window.moveTo(0,0);
if (document.all) {top.window.resizeTo(screen.availWidth,screen.avai lHeight);}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.wi ndow.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
-->
</Script>

LSB-Mèo Đen
03-12-2003, 20:39
<!-- Redirect a browser depending on the version/OS. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function CheckBrowser(){
if((parseInt(navigator.appVersion) < 4 )){
window.location.href="InternetExplorer4OrLess.html"
} else {
if(navigator.platform == "MacPPC") {
window.location.href="Macintosh.html"
} else {
if(navigator.platform == "Mac68k") {
window.location.href="68kMacintosh.html"
} else {
if (navigator.appName == "Microsoft Internet Explorer") {
window.location.href="InternetExplorer5OrGreater.html"
}else {
if(navigator.platform == "Win32") {
window.location.href="Windows32Bit.html"
} else {
if(navigator.platform == "Win16") {
window.location.href="Windows16.html"
} else {
window.location.href="Undefined.html"
}
}
}
}
}
}
}
// -->
</SCRIPT>
<Body OnLoad="CheckBrowser();">

LSB-Mèo Đen
03-12-2003, 20:40
<style>
<!--
#leftright, #topdown{
position:absolute;
left:0;
top:0;
width:1px;
height:1px;
layer-background-color:black;
background-color:black;
z-index:100;
font-size:1px;
}
--></style>
<div id="leftright" style="width:expression(document.body.clientWidth-2)">
</div>
<div id="topdown" style="height:expression(document.body.clientHeight-2)">
</div>
<script language="JavaScript1.2">
<!--
if (document.all&&!window.print){
leftright.style.width=document.body.clientWidth-2
topdown.style.height=document.body.clientHeight-2
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}


function followmouse1(){
//move cross engine for IE 4+
leftright.style.pixelTop=document.body.scrollTop+e vent.clientY+1
topdown.style.pixelTop=document.body.scrollTop
if (event.clientX<document.body.clientWidth-2)
topdown.style.pixelLeft=document.body.scrollLeft+e vent.clientX+1
else
topdown.style.pixelLeft=document.body.clientWidth-2
}

function followmouse2(e){
//move cross engine for NS 4+
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}

if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}

function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
window.onload=regenerate2
//-->
</script>

LSB-Mèo Đen
03-12-2003, 20:43
<!-- If your page is loaded in a frame, this will reload it in
an entire window. -->
<Script Language="JavaScript">
<!-- Begin
if (window != top) top.location.href = location.href;
// End -->
</Script>

LSB-Mèo Đen
03-12-2003, 20:57
<!-- Will send the browser back one page.Use 0 to reload the
current page. -->
<Script Language="JavaScript">
<!-- Begin
history.go(1)
// End -->
</Script>

LSB-Mèo Đen
03-12-2003, 20:59
tôi viết đến đây thôi, sẽ tiếp tục đưa lên nếu mọi người thấy đuwọc, còn ko được thì tôi sẽ ko đưa lên nữa, chúc mọi người cảm thấy thoải mái nhé, chúc vui vẻ.

anhyeuemnhieudl
13-12-2003, 20:07
hay lắm đó tiếp tục đi mình cũng có viết mấy bài đó vào xem thử nha nếu hay thi viết tiếp chứ hình như trong sơn trại mình cũng it người biết lắm phải ko ?

LSB- *Hoa Sao*
13-12-2003, 22:23
Bác có đoạn mã Script nào hay hay không, mấy cái này em làm thử rồi, cũng không có gì ghê gớm cả. Em thích đoạn nào thiên về kĩ thuật, thuật toán một chút chứ không khoái xử lý dữ liệu và Form.

anhyeuemnhieudl
16-12-2003, 19:54
trừi vào thử mấy cái scrip của tui thử di coi hay thì nói nghen mấy cái đo mình nghĩ cũng hay lắm đó nhưng mình thì cũng muốn tìm những đoạn scrip khác hay hơn nếu bạn có thì post lên cho xem vo3wsi nha

nhatdang_daisu
09-12-2011, 14:02
Hiện tại mình đang dùng đoạn

<a href="ymsgr:sendim?giangsaymobile"><img src="://opi.yahoo.com/online?u=giangsaymobile&m=g&t=2" border="0" name="imgNick" onMouseOver="window.status='IM me'; return true;" /></a>

để gọi yahoo online hoặc offline

Mình đang muốn thêm phần khi click vào thì có sẵn phần tin soạn thảo theo minh đặt trước

<a href="ymsgr:sendim?giangsaymobile&m=Tôi đang cần mua"><img src="//opi.yahoo.com/online?u=giangsaymobile&m=g&t=2" border="0" name="imgNick" onMouseOver="window.status='IM me'; return true;" /></a>

Đoạn sau tôi đang cần mua mình muốn gọi link hiện tại của sản phẩm đó thì cần làm như nào vậy.


VD: như đoạn mã thứ hai thì nội dung soạn sẵn chỉ là Tôi đang cần mua

chẳng hạn link sản phẩm khách hàng đang truy cập:
suaiphone.org/vi/iphone-store/man-hinh-iphone/man-hinh-iphone-4.html

thì nội dung tin soạn sẵn là Tôi đang cần mua suaiphone.org/vi/iphone-store/man-hinh-iphone/man-hinh-iphone-4.html

thì cần phải thêm những gì để đạt được mục đích

Ai biết giúp mình với.

Xin cảm ơn

hoanganhcodon
19-12-2011, 16:15
woa chang hieu gi het,cai gi ko sao ma hieu duoc chu may bac

khongduockhocvn
24-12-2011, 16:37
woa chang hieu gi het,cai gi ko sao ma hieu duoc chu may bac

cái này là code để viết trên web đó bạn. code gọi yahoo vào web:D

thien_long46
16-02-2012, 13:27
thank các bạn, rất có ích ....................................