[CODE] Scarlet's Library
Page 1 of 1
[CODE] Scarlet's Library
So, this is a total amount of my JS library. Remember, this is not a framework. But this is a library that I have. Simple but maybe useful.
[SNIPPET] Sort Variables
This function would sort variables. So, in the code above, I'll insert a variable containing an empty array, then add the value in the empty array. So an example to this might be :
So, my task for this function is, improve the code and build more larger codes with it.
[SNIPPET] Check Input
This little snippet would check for inputs.
Basically I've using the getElementsByTagName method. So, this method would get elements from every <input> HTMLCollection. So, with using this, you'll have a possibility to check for <input> HTML. Even you can build a code which allows you to alert something when there's something in the input.
Remember, window.close(); sometimes didn't really work.
So, that's all of snippets I have. I'll think for another one.
[SNIPPET] Sort Variables
- Code:
function sortVar(variable) {
arr = [];
arr.push(variable);
}
This function would sort variables. So, in the code above, I'll insert a variable containing an empty array, then add the value in the empty array. So an example to this might be :
- Code:
var scarlet = "Scarlet";
var wasgreat = scarlet + " was great";
sortVar(scarlet, wasgreat);
So, my task for this function is, improve the code and build more larger codes with it.
[SNIPPET] Check Input
This little snippet would check for inputs.
- Code:
var inp = document.getElementsByTagName('input');
Basically I've using the getElementsByTagName method. So, this method would get elements from every <input> HTMLCollection. So, with using this, you'll have a possibility to check for <input> HTML. Even you can build a code which allows you to alert something when there's something in the input.
- Code:
var inp = document.getElementsByTagName('input');
for(var i=0;i<inp.length;i++) {
// well sometimes window.close didn't really works but this is just an example
var close = window.close();
if(close) {
if(i => 1) {
alert("you're about exit");
}
}
}
Remember, window.close(); sometimes didn't really work.
So, that's all of snippets I have. I'll think for another one.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum