Skip to content

About

A minimalistic javascript for the jquery babied...

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sQS

A minimalistic javascript for the jquery babied...

It uses querySelectorAll or getElementById to get a DOM-Node.

Changes

         Date              Version    Info
14.12.2018 1.2 merged some changes from smdQS, cleanup
08.03.2018 1.1 merged changes from smdQS, added demo files
15.01.2018 1.0 initial fork of smdQS, dropped nativeOS code

Examples

  • ajax() call:
sQS().ajax({
	url:		"/testscript.php", 		//required
	method:		"GET",
	data:		{},
	callback:	function( returnData ) {	//required
				console.log(returnData);					
			},
	errorCallback:	function( XMLHttpRequest ) {
				console.log(XMLHttpRequest);
			}
});	
  • ready() - Execute something on document ready:
sQS().ready(function() {
	console.log("document is ready");					
}
  • requireJS() - load an other js:
sQS().requireJS("/js/somejsfile.js", function() {
	console.log("js file is loaded.");					
}
  • requireCSS() - load an other css:
sQS().requireCSS("/css/somecssfile.css", function() {
	console.log("css file is loaded.");					
}
  • working with classes and selectors:
var myNode = smdQS("#idOfMyNode");
if (myNode.hasClass("aNiceClass")) {
	myNode.removeClass("aNiceClass");
}
  • working with a array of nodes:
var aListOfNodes = smdQS(".btn");
if (aListOfNodes !== null) {
	var isAList = aListOfNodes.isList;

	//...

	aListOfNodes.forEach(function(oneOfThisNodes, index, array) 
	{
		oneOfThisNodes.removeAttribute("onclick");
		oneOfThisNodes.addEventListener("click", function() 
		{
			console.log("You have clicked on the button with the index " + index);
		});
	});
} 

sQS_jsHost

If the javascript variable sQS_jsHost is set, sQS().ajax() uses it as hostname to call all requests to. If a url has already a hostname the variable is ignored.

Misc

This version includes a forked version of docReady (https://github.com/jfriend00/docReady)

Matthias Weiß

About

A minimalistic javascript for the jquery babied...

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages