- Posts Tagged ‘Javascript’

Array Join instead of String concat in Loop in JavaScript!

You may have seen array join after pushing data inside Array for concatenation work in JavaScript. That was faster method compared to doing large number of string concatenation in older Browser. Browser used to crash in such large number of concatenation. So, Array Join was the workaround. Now, change your… (Continue)

YUI Seed Files – yui.js, yui-base.js and yui-core.js – YUI3 Tutorial

YUI3 has three kind of seed files: yui.js, yui-base.js and yui-core.js. In this you may have used yui.js file always. (<script src=""></script>) I just thought to read about other kind of seed files and its pros and cons. YUI main seed file (YUI.js) includes loader (dynamically load missing modules as… (Continue)

YUI3 Tutorial: YUI Attribute Selector. Working with Attribute Selector

Here is a separate article on attribute selector. The attribute selector was not working in flexible way. I was facing problem is excluding some some tag based on attribute differences. Here is the HTML snippet I was using and I will use here for Attribute selector example: <a rel="me" href="">My… (Continue)

Learn YUI3: Accessing Attributes of Element and changing it

Here we will play with element's attribute. We will access attributes and change it. It is a part of YUI node learning series. <img class="hotels" src="Marina-Bay-Sands_222812.jpg" widht="310" height="207" /> <button id="bttnImg">Change Image attributes (src, width and height)</button>'#bttnImg').on('click', function(e) { var hotels = Y.all('.hotels'); // get first one and start… (Continue)

Learn YUI3 – Create new Element/Node and Apply CSS

I am continue on learning YUI and posting it here for all to read as part of YUI3 tutorial. This post is a part of YUI node under YUI tutorial series. Creating new Element using YUI3: The below example will create DIV, SPAN and P and present different different scenarios.… (Continue)

YUI3 Tutorial: Working with Node – 2. Dynamically Add, Remove and Toggle CSS Class

Here is another post for YUI3 Node. Here I am going to present examples for adding Class, removing class and toggle css class dynamically using YUI. YUI3 provides .addClass('foo'), .removeClass('foo'), .toggleClass('foo'), .hasClass('foo') and .replaceClass('foo', 'bar') for dynamically working with class on an element. Javascript used in the example: YUI().use('node', function(Y)… (Continue)