Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Mr.Easybb (1587)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Bloodbath (745)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Rukiafan (533)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Dom (513)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
puppycheese (446)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
pedro (330)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Neymar (301)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Hitsu (281)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 
Flora (275)
Topics tagged under profile-advanced-right on AvacWeb Vote_lcapTopics tagged under profile-advanced-right on AvacWeb Voting_barTopics tagged under profile-advanced-right on AvacWeb Vote_rcap 

Search found 2 matches for profile-advanced-right

LGforum
Search in: General Discussions
Topic: jQuery? No more!
jQuery? No more!
on Sun 20 Sep 2015, 22:11 by LGforum
In this instance, neither are better on their own. It depends on the situation; if you are going to be manipulating any of the other elements any further then the first option is better since you have everything you need in variables already. For a short and concise way of simply grabbing the text then the second is better. It's all relative really.

I want to share here am absolutely tiny function I use on a Avacweb and other places which prevents me having to do any of the above.
Code:
[panda=js]_.getby = function(selector, context) {
      context = context || document;
         
      switch(selector.charAt(0)) {
         case '#' :
            return context.getElementById( selector.substr(1) );
         case '.' :
            return context.getElementsByClassName( selector.substr(1) );
         default :
            return context.getElementsByTagName( selector );
      }
};

It's basically just a shortcut function for all the annoying getElementsBy functions.
Here's how I'd do it:
[ic]_.getby('strong', _.getby('.module', _.getby('#profile-advanced-right')[0])[0].innerText[/ic]
It may look a little confusing for this specific example, but ultimately the _.getby function has been a favourite of mine for a while.
[ic] _.getby('.classname') _.getby('#id') _.getby('tagname')[/ic]
Forum: General Discussions | Topic: jQuery? No more!
Ch@lo Valdez
Search in: General Discussions
Topic: jQuery? No more!
jQuery? No more!
on Sun 20 Sep 2015, 20:54 by Ch@lo Valdez
ok, i work in hospitals, i'm a doctor, codes is just for do better my forum,just for fun, it's a hobby, jQuery is more easy to learn than pure javascript or vanilla, in the last 3 years i made my own codes all i jquery, now i try to understand de pure form of javascript , i know, my english sucks, i think all you guys started use easy ways, i see old code in your olds boards using jquery, please be patient with us.


ok y use this line several timer in a global variable:

$("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text();

how convert in pure javascript??

thanks
Forum: General Discussions | Topic: jQuery? No more!
Back to top