Difference between revisions of "User:Andr3w/vector.js"

From SQLZOO
Jump to: navigation, search
(Blanked the page)
Line 1: Line 1:
 
+
//Deal with variations in the "how to" scripts
 +
//Copy this to common.js when tested
 +
$(
 +
  $('div.ht').each(function(){
 +
    var lnglst = $('.def',this);
 +
    var varlst = [];
 +
    if (lnglst.length>1){
 +
      $('.def',this).each(function(){
 +
        var clist = $(this).attr('class').split(' ');
 +
        for(var i=0;i<clist.length;i++)
 +
          if (clist[i].length>2 && clist[i].substr(1,2)=='e-')
 +
            varlst.push({engine:clist[i].substr(3),$(this)})
 +
      });
 +
    }
 +
    console.log(varlst);
 +
  })
 +
)

Revision as of 11:07, 6 March 2014

//Deal with variations in the "how to" scripts
//Copy this to common.js when tested
$(
  $('div.ht').each(function(){
    var lnglst = $('.def',this);
    var varlst = [];
    if (lnglst.length>1){
      $('.def',this).each(function(){
        var clist = $(this).attr('class').split(' ');
        for(var i=0;i<clist.length;i++)
          if (clist[i].length>2 && clist[i].substr(1,2)=='e-')
            varlst.push({engine:clist[i].substr(3),$(this)})
      });
    }
    console.log(varlst);
  })
)
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense