• ARCHIVES 
  • » Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Pages: 12

Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

myparis
» FTalker
FTalk Level: zero
118
0
1969-12-31

Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simple line [color=#999999]____________________________________________________________[/color] [b]FEATURES :[/b] :arrow: small file size, only 508 bytes :arrow: tested in Firefox3, IE6, IE7 and Opera9.51 :arrow: easy to use :arrow: can handle infinite length of expression :arrow: helpful for newbies :arrow: and made by only me :wow: [color=#999999]____________________________________________________________[/color] [b]THE CODE:[/b] [url=http://mark16.fileave.com/dom.js][img]http://i173.photobucket.com/albums/w76/myparis16/ss-1.jpg[/img][/url] [color=#999999]____________________________________________________________[/color] [b]HOW TO USE:[/b] PARAMETERS: $(expression,parent); [i]expression[/i]: this is compose of [b]Id[/b], [b]ClassName[/b] or [b] TagName[/b] of a tag separated by [b]SINGLE SPACE[/b] sample: $('#0 table[0] .imgblock200[0] img[0]') [color=#cccccc]________________________[/color] [i]parent[/i](optional): if parent is not declared the object ducument will be use sample: $('table[0] .imgblock200[0] img[0]', $('#0')) [color=#cccccc]________________________[/color] For example [img]http://i173.photobucket.com/albums/w76/myparis16/ss2-2.jpg[/img] i want to get the message contains in the 3rd instance of className [b]data[/b] in my comments which is "[i]salamat ng mrami.. ^^[/i]" to get that you have to code this: [quote]a = document.getElementById(18).getElementsByTagName('*'); b = 'data'; c = []; for(i=0;i<a.length;i++){ d = a[[color=#000000]i[/color]].className.split(' '); for(j=0;j<d.length;j++){ if(d[j]==b){ c.push(a[[color=#000000]i[/color]]); break } } } c[2].getElementsByTagName('li')[2].innerHTML[/quote] using my function [quote]$('#18 .data[2] li[2]').innerHTML or $('#18 .data[2] li')[2].innerHTML or $('.data[2] li[2]',$('#18')).innerHTML or $('.data[2] li',$('#18'))[2].innerHTML[/quote] see your codes now are smaller and more efficient to use, you can combine any [b]Id[/b] or [b]ClassName[/b] or [b]TagName[/b] in just one string to map the one that you need. Hope it helps, ~im open for any suggestions [color=#999999]____________________________________________________________[/color] [color=#555555]older post[/color] [spoiler][quote][b]CROSSBROWSER[/b] sure for IE and Firefox only. tnx to sir [url=http://theftalk.com/profile.php?id=3509]feruzz[/url] :thumbsup:[/quote] I release this too early because im very excited :lol: After playing with the codes, I've invented a bunch of functions that will easily get the content in your page according to its command =D This will make you design and modify your page easily because all you need to do is call the function that carries the content like URL, innerHTMl etc.. confusing? Here it is: [color=green]The function:[/color] [color=red][b]getCommentName([i]index_num[/i])[/b][/color] [color=green]Parameter:[/color] [b]index_num[/b] Any number from 1 - 10, represent the 10 commentators in your public comments [color=green]Usage:[/color] get the name of the commentator according to its index __________________________________________________ [color=green]The function:[/color] [color=red][b]getCommentLink([i]index_num[/i])[/b][/color] [color=green]Parameter:[/color] [b]index_num[/b] Any number from 1 - 10, represent the 10 URL of commentators in your public comments [color=green]Usage:[/color] get the URL of the commentator according to its index __________________________________________________ [color=green]The function:[/color] [color=red][b]getCommentDate([i]index_num[/i])[/b][/color] [color=green]Parameter:[/color] [b]index_num[/b] Any number from 1 - 10, represent the 10 dates posted in your public comments [color=green]Usage:[/color] get the date posted according to its index __________________________________________________ [color=green]The function:[/color] [color=red][b]getCommentData([i]index_num[/i])[/b][/color] [color=green]Parameter:[/color] [b]index_num[/b] Any number from 1 - 10, represent the content in your public comments [color=green]Usage:[/color] get the content of a comment according to its index __________________________________________________ [color=green]The function:[/color] [color=red][b]getCommentPic([i]index_num[/i])[/b][/color] [color=green]Parameter:[/color] [b]index_num[/b] Any number from 1 - 10, represent the URL of the pictures of commentators in your public comments [color=green]Usage:[/color] get the URL of the picture according to its index __________________________________________________ [color=green]Examples:[/color] Here is my comments: [img]http://i173.photobucket.com/albums/w76/myparis16/p1-2.jpg[/img] Observe the functions: [b]getCommentName([i]2[/i])[/b] = Returns "Myparis" [b]getCommentName([i]6[/i])[/b] = Returns "Marks" [b]getCommentLink([i]2[/i])[/b] = Returns "http://profiles.friendster.com/20140652" [b]getCommentLink([i]6[/i])[/b] = Returns "http://profiles.friendster.com/64678447" [b]getCommentDate([i]2[/i])[/b] = Returns "Posted 03/19/2008 1:14 pm" [b]getCommentDate([i]6[/i])[/b] = Returns "Posted 03/19/2008 9:13 am" [b]getCommentData([i]2[/i])[/b] = Returns "testing" [b]getCommentData([i]6[/i])[/b] = Returns "Comment 2" [b]getCommentPic([i]2[/i])[/b] = Returns "http://photos-652.friendster.com/e1/photos/25/60/20140652/1_557103409m.jpg" [b]getCommentPic([i]6[/i])[/b] = Returns "http://photos.friendster.com/photos/74/48/64678447/1_276582702m.jpg" __________________________________________________ For now i just have 5 functions available, more to come soon.. :D To use it download this [url=http://mark16.fileave.com/Friendster/testpage/myparisFSContentLibV1.js]myparisFSContentLibV1[/url] then merge it in your js file like this: [quote]var fscontentlib = document.createElement("script"); fscontentlib.src = "[b]URL_OF_myparisFSContentLibV1_file[/b]"; document.getElementsByTagName("head")[0].appendChild(fscontentlib);[/quote] Then in your onload handler, Initialized the main function first before your use the other functions i made, so it will succesfully get the contents: This is the main function [b]MYPARIS_INIT_FS_CONTENT_LIB()[/b], put it in the very first of all other functions [quote]if(!attachOnLoadHandler(function(){onProfileLoad()}))window.onload=function(){onProfileLoad()}; function onProfileLoad(){ [b]MYPARIS_INIT_FS_CONTENT_LIB()[/b]; [i]other_functions();[/i] [i]other_functions();[/i] [i]other_functions();[/i] [i]other_functions();[/i] }[/quote] Then thats it you can now use the 5 functions i made, and you can now design whatever you want in your comments area or in others... Its up to you how will you design it like what i did Img Previews: [img]http://i173.photobucket.com/albums/w76/myparis16/p2-2.jpg[/img] [img]http://i173.photobucket.com/albums/w76/myparis16/preview3.jpg[/img] Live Preview: http://profiles.friendster.com/markstestpage [b]Combine this tutorial with http://theftalk.com/t24164-Flash-Tuts-Using-FlashVars.html so you can make a trick like this http://profiles.friendster.com/myparis [/b] More functions to come, ill just update my post. again here his the available functions for now [quote]getCommentName(index_num); getCommentLink(index_num); getCommentDate(index_num); getCommentData(index_num); getCommentPic(index_num);[/quote] [/spoiler]

Last edited by myparis (2008-08-31 10:29:11)

Chezter18
» Banned
FTalk Level: zero
237
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

great... 1st comment... great....:midfinger: continue good working...
eehjhay
» FTalkWhiz
FTalk Level: zero
2692
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Hahaha you're using AdBlock plugin too? hahaha... Great tutorial dude. I like the way you post your tutorial =)
angelalaine
» FTalkManiac
FTalk Level: zero
860
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Coolness thanks for sharing great tutorial...Lets try it Hope I can apply it :lol:
arcatari
» FTalkElite
FTalk Level: zero
5370
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

It's very˛ cool guys.. i will try this one....:thumbsup:
myparis
» FTalker
FTalk Level: zero
118
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

[b]@eehjhay[/b]: haha.. yap.. i love FF, so many useful plugins that are available. Tnx for appreciating my work :D just reply guyz if theres something wrong in my tutorial
bobskie
» FTalkAddict
FTalk Level: zero
596
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

haha...finally,u release the tutorial...i'l try this :thumbsup: tnx sir for the tutorial...=D
Mbah-Dukun
» n00b
FTalk Level: zero
76
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

great :thumbsup: .. thx for sharin dude :thumbsup:
BwizetT
» FTalkGeek
FTalk Level: zero
1015
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

ha ha nice ei good job buddy keep it up n thnx foe sharing :eh::ninja:
cklahrckiey
» FTalkFreak
FTalk Level: zero
1891
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

nice one dude!!! hehehe :D
nothinglast
» n00b
FTalk Level: zero
31
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Sir paris... i dont get it.... can u please give an example code.. a compiled code w/c can be used by anyone/everyone.. an example code.,:drool:
myparis
» FTalker
FTalk Level: zero
118
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

yap i admit it, this tutorials is confusing.. :D ahmm try this codes: <">again call this function [b]MYPARIS_INIT_FS_CONTENT_LIB()[/b] at the very first of all your functions to initialize My FS Content Library. notice the function [b]whatEverNameYouLike()[/b](not part of My FS Content Library). I use it to used the function [b]getCommentPic()[/b] which is predefined in my library. It just get all the URL of pictures of your friends in your comment box. You can use this trick for advanve editing in your profile...

Last edited by myparis (2008-03-21 11:32:12)

Misa10
» n00b
FTalk Level: zero
8
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

imma try this too!! :paranoid:
kangkong10
» FTalkManiac
FTalk Level: zero
617
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

:O great job.. thanks for this code and the tutorial.. keep on sharin' dude.
burnok
» n00b
FTalk Level: zero
72
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

hmm...this one look cool, eh...maybe il try it some other time...:eh::eh:...enx for sharing.
slashedkite
» FTalkManiac
FTalk Level: zero
973
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

it's too confusing for me.. but im willing to learn it.. =)
azher15
» FTalker
FTalk Level: zero
112
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

uhh I'm confuse with these things.. can you please explain this to me very well? sorry for the disturbance.. but i appreciate ur work.. i like it! that's why i must learn it! thanks again buddy!
nineclouds
» n00b
FTalk Level: zero
87
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

:o cool trick ! :thumbsup: i'll try this even it makes me a lil confuse . :D thanls for share bro ! :):thumbsup:
babyzchen
» FTalker
FTalk Level: zero
264
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

nice again kuya... :lol: thanks for sharing this trick.. i'l try this if i have enough time.. :D
myparis
» FTalker
FTalk Level: zero
118
0
1969-12-31

Re: Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

uhmm sorry guyz for the inconvenience :( just give me time to clear my tutorial, because im kinda busy right now, ill fix this so everyone can use it =) btw, tnx for the responses, i appreciate it.. :D
  • ARCHIVES 
  • » Just sharing this function i made, this simple function will allow you to use: :arrow: [b]getElementById[/b] :arrow: [b]getElementsByTagName[/b] :arrow: [b]getElementsByClassName[/b] in just one simp

Pages: 12

Board footer

© 2024 F Talk

Current time is 11:05

[ 10 queries - 0.040 second ]
Privacy Policy