lineriwant.blogg.se

Klib alternatives
Klib alternatives











  1. #Klib alternatives code#
  2. #Klib alternatives free#

#Klib alternatives code#

For example, if you want to test the code below you just follow these steps:Ģ. I've made it very easy to test your kLib by going to that page and typing in code that includes kLib methods. I have created a web page that allows a person to test any JavaScript (JS) library very easily. If nomes are provided then the refrence property is generated inside the nodes property of the tree. This will allow the user to directly access any element if he so desires. User can also provide property names to create ana alias for any elements index in the tree. newElement() is defined in the Global Methods section. The tag names can be of the same format as specified for newElement(). When true is passed in place of makeDumpString then the return array has a special property called dumpStr which can be used to easily identify the array index of any specific node. Return: A tree (as array) containing all the nodes (format is same as it was at the time of passing).

klib alternatives

appendChildElementTree(obj treeObj alias addChElemTree(obj treeObj It takes element node-tree data via a specially designed array and then appends the tree to the calling node.Var txtnodes = node.prependTextNode( " Hello\nWorld", true) Var textnode = node.prependTextNode( " Hello World") trim() Returns a new string with whitespaces removed from beginning and end of a string.

#Klib alternatives free#

If you find any bug or have any ideas to improve the code please feel free to contact me via email.ĭo you find it useful? Please let me know in the comments.īrief Descriptions of kLib Functions/Properties Version: 1.0.4 I have tested them in Chrome (Win and Android), Firefox (Win and Android), Opera Mobile (Android) and IE10. I intend to work on it whenever I have free time.įollowing is the list of functions provided by kLib. In addition to the general overlay function, kLib includes overlayed (non-blocking) alternatives to the alert, confirm, and prompt function. The overlay creation is very flexible and can be used to create virtually any kind of overlay. kLib contains many such functions to make your life easier.Īpart from the DOM manipulation functions kLib has set of functions to create overlays over any visible HTML element (including the body). This method allows me to create the whole element tree (of any size) in just one line. [ " hRef=h2#myHeader", " div.blueBorder", Var tree = document.getElementById( " mydiv").addChElemTree( The first alpha versions allowed me to achieve the following result. Towards this goal I started writing kLib. small code as well as easy access and direct control. I wanted to get the best of both worlds i.e.

klib alternatives

If there is a lot of this kind of operations (which is usually the case) then the second approach makes much sense, because we will not need to parse the DOM tree for the intended element.

klib alternatives

But it gave me direct access to the span element to add an event handler. The second code achieved the same result but the code was a little longer. Var span = document.createElement( " span") H2.innerHTML = " My Header" // or h2.appendChild(document.createTextNode("My Header")) var p = document.createElement( " p") Var div2 = document.createElement( " div") Var div = document.getElementById( " mydiv")













Klib alternatives