/    Sign up×
Community /Pin to ProfileBookmark

can you give me any cool javascript?

please

to post a comment
JavaScript

16 Comments(s)

Copy linkTweet thisAlerts:
@blah1985Jun 01.2005 — ????
Copy linkTweet thisAlerts:
@JupacJun 01.2005 — [font=Trebuchet MS] search them on google[/font]
Copy linkTweet thisAlerts:
@UltimaterJun 01.2005 — This is a JavaScript autoComplete designed by me which I just finished today:
<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;!-- ripcurlksm, kmccormick05 //--&gt;
&lt;p&gt;Write your 5 favorite colors: &lt;br&gt;
1


&lt;script type="text/javascript"&gt;
var offsetT=25
var offsetL=2
var caller_Element=null

var autoFill1=new Array();
autoFill1[0]="Red"
autoFill1[1]="Green"
autoFill1[2]="Blue"
autoFill1[3]="Purple"
autoFill1[4]="Yellow"
autoFill1[5]="Black"
autoFill1[6]="White"

var autoFill2=new Array();
autoFill2[0]="Ultimater"
autoFill2[1]="Ultimate"

var autoFill3=new Array();
autoFill3[0]="Umbrella"
autoFill3[1]="Ultra"

var autoFill4=new Array();
autoFill4[0]="Umbrella"
autoFill4[1]="Ultra"

var autoFill5=new Array();
autoFill5[0]="Umbrella"
autoFill5[1]="Ultra"
autoFill5[2]="Ulimater"
autoFill5[3]="Ultra"
autoFill5[4]="Red"
autoFill5[5]="Green"
autoFill5[6]="Blue"
autoFill5[7]="Purple"
autoFill5[8]="Yellow"
autoFill5[9]="Black"
autoFill5[10]="White"



function autoFiller(This,arr){
var possiblePeople=[]
if(This.value.length==0)return UpdateChoices(possiblePeople,This)
for(var i=0;i&lt;arr.length;i++)
if(This.value.substring(0,This.value.length).toLowerCase()==arr[i].substring(0,This.value.length).toLowerCase()&amp;&amp;This.value.toLowerCase()!=arr[i].toLowerCase())
possiblePeople[possiblePeople.length]=arr[i]
UpdateChoices(possiblePeople,This)
}

function UpdateChoices(arr,This){
var el=document.getElementById("autoCompleter")
if(arr.length==0){
el.innerHTML="";
el.style.display="none";
return false
}
el.innerHTML=createHTML_List(arr,This)
el.style.display="inline";


if("posLeft" in el){
el.posLeft=(getPositionLeft(This)+offsetL)+"px"
el.posLeft=(getPositionTop(This)+offsetT)+"px"
}
else if("style" in el &amp;&amp; "left" in el.style){
el.style.left=(getPositionLeft(This)+offsetL)+"px"
el.style.top=(getPositionTop(This)+getHeight(This))+"px"
}

}

function createHTML_List(arr,This){
caller_Element=This
var outHTML=""
for(var i=0;i&lt;arr.length;i++){
outHTML+="&lt;span id=s style='cursor: pointer;' onmouseover='highlight_span(this)' onmouseout='unhighlight_span(this)'onclick='autoC_updater(""+arr[i]+"")'&gt;"+arr[i]+"&lt;/span&gt;"
if(i!=arr.length)outHTML+="&lt;br&gt;"
}
return outHTML
}

function autoC_updater(picked){
UpdateChoices([])
caller_Element.value=picked
}

function highlight_span(This){
This.style.backgroundColor="highlight"
This.style.color="menu"
}

function unhighlight_span(This){
This.style.backgroundColor="skyblue"
This.style.color="white"
}

function getPositionLeft(This){
var el = This;var pL = 0;
while(el){pL+=el.offsetLeft;el=el.offsetParent;}
return pL
}

function getPositionTop(This){
var el = This;var pT = 0;
while(el){pT+=el.offsetTop;el=el.offsetParent;}
return pT
}

function getHeight(This){
if("offsetHeight" in This)return This.offsetHeight
return offsetT

}

&lt;/script&gt;

&lt;input type="text" onkeyup="autoFiller(this,autoFill1)"&gt;
&lt;br&gt;
2
&lt;input type="text" onkeyup="autoFiller(this,autoFill2)"&gt;
&lt;br&gt;
3
&lt;input type="text" onkeyup="autoFiller(this,autoFill3)"&gt;
&lt;br&gt;
4
&lt;input type="text" onkeyup="autoFiller(this,autoFill4)"&gt;
&lt;br&gt;
5
&lt;input type="text" onkeyup="autoFiller(this,autoFill5)"&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;input type="submit" name="Submit" value="Submit"&gt;
&lt;/p&gt;
&lt;span id="autoCompleter" style="display:none; position: absolute; z-index: 200; background-color: skyblue; border: 2px solid royalblue; color: white; cursor: default; left: -1000px; top: -1000px;"&gt;&lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;

Try running the code and typing the word "green" into the first field.

Users with Javascript enabled get the feature but userswith JS disabled aren't missing out on anything essential.

You can easily customize the autocomplete list for each field.

[color=royalblue]Tested in FF and IE[/color]
Copy linkTweet thisAlerts:
@poiuyJun 01.2005 — Tons of cool javascript on this site http://javascript.internet.com

It's the site I go thru to get to this one
Copy linkTweet thisAlerts:
@poiuyJun 01.2005 — Ultimater that is a very cool script. Just checked it out.
Copy linkTweet thisAlerts:
@UltimaterJun 01.2005 — Poiuy, thanks for the complements. It can even be furtherly enhanced with a control panel to append with custom entires. It can even be used for multipul fields by using a seperate array for each field. Don't be intimidated by the code size cas' most of it is function-declaration, which can be inserted into an external JS file. The only remaining javascript code, believe it or not, will be your array declarations.

And you can even avoid that by passing a generic array dirrectly into your autoFiller() function.
Copy linkTweet thisAlerts:
@SpectreReturnsJun 01.2005 — Hey Ultimater, same guy? I got sent a nasty PM about accusing him, did you too?
Copy linkTweet thisAlerts:
@JPnycJun 01.2005 — Accusing whom of what?
Copy linkTweet thisAlerts:
@SpectreReturnsJun 01.2005 — Of having multiple accounts. Sorry for hijacking this thread, if it's legit, but Ultim. posted some nice stuff in here.

http://www.webdeveloper.com/forum/showthread.php?t=66964 (which happens to be the accused thread)

Yeah, so sorry about being paranoid, but... whatever.
Copy linkTweet thisAlerts:
@UltimaterJun 01.2005 — I'd appreciate it if we can get these off-topic posts removed.


What's me accusing mr.-so-and-so of something got to do with this thread? This isn't the place for it.

I don't know how to handle the issue you brought-up better than this:

I'm a gentleman and don't start-up with people. However, in this case when that member is suspected of abusing the forums and it is even a second thought to ban the user, I don't know what to say -- the person posted a flamer at me. ?

Just to clarify for the admin, poosnaps got banned for posting really mean stuff and his last post was to me in that thread. Between post #10 and post #11 was the deleted post. He just popped-in random threads and said something real mean in specific to certain people. And just by coinstadence, poosnaps always posted into a thread that Mausau2000 started. Also Mausau2000 even admits to being his friend.

I can go on and on about this and even talk about other fingers pointing to my belief, but I don't want to start anything up. So let's just close it.

However, this is and was only a suspicion that poosnaps is really Mausau2000.

I've still been recieving the endless posts from this member, and I try to turn the other way, but what can I do?

JPnyc or LeeU, can you delete these posts and also my posts back in that thread so no one gets the wrong impression?
Copy linkTweet thisAlerts:
@rimianJun 01.2005 — <script type="text/javascript">

alert("This script is cool.");

</script>
Copy linkTweet thisAlerts:
@UltimaterJun 01.2005 — Thanks for the additional complements, rimian. ?
Copy linkTweet thisAlerts:
@Mausau2000Jun 02.2005 — Ultimater that script is very cool is that what gmail does when you type known email addresses in?
Copy linkTweet thisAlerts:
@UltimaterJun 02.2005 — Wow!, you're right, I had no idea GMail was doing that. They simply made it blend in too well ? I can study their code a bit and see if I get any other ideas how to improve my version.

Keep the complements come'n! ?

Nah, I had enough complements on this script so far, the script still has more for improvement.
Copy linkTweet thisAlerts:
@Mausau2000Jun 13.2005 — Gmail stores all your known email addresses in a file in your tempertaroy internet files.

This may be where gmail gets the infomation to do that script that u made.

I think it may be a secutary risk?

Could some spammer access that file and spam people?
Copy linkTweet thisAlerts:
@blah1985Jun 13.2005 — Gmail stores all your known email addresses in a file in your tempertaroy internet files.

This may be where gmail gets the infomation to do that script that u made.

I think it may be a secutary risk?

Could some spammer access that file and spam people?[/QUOTE]

nope at least not on a good browser because a site can only access files it asigns and I'm sure its encrypred, though I've never looked.
×

Success!

Help @192_168_1_1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...