A light JavaScript function library
Functions | Files | Usage | Qs.min.js raw
Selectors
q Query
qi Query by Id
qa Query All
qs Query in Sub element
qas Query All in Sub element
For each
ff For each call Function
qaff Query All For each call Function
qasff Query All in Sub element For each call Function
fif For each Integer from 0 call Function
Classes
cls add and remove CLaSses
qacls Query All For each add and remove CLaSses
qascls Query All in Sub element For each add and remove CLaSses
Requests
r Request
rp Request Post
rg Request Get
rgr Request Get Raw link
Other
cloneTemplate
elementFromHtml
onEnter
onScrollNearEnd
See the API or go to Documentation wiki page.
- In the query functions the the CSS selectors are be used, eg.
q("#side > img")
,qa(".item")
andqaff(".item.hidden", function(i) {...})
. - The
params
parameters in the request functions are objects, eg.{name:"maanoo", color:"red"}
,{json:"", count:"12"}
and{}
(they will be stringified intoname=maanoo&color=red
,json&count=12
and empty string). - In the
callback
functions thetext
variable contains the response text and thecode
variable the response code.
File | Description |
---|---|
Qs.js | The library |
Qs.min.js | The library compressed with Closure Compiler (Compress now) |
parts/Qs.?.js | The library split into independent sub-libraries |
Put the Qs.min.js in the project folder and add the following tag to the header of the html page
<script src="Qs.min.js"></script>
For faster loading you can paste the content of the Qs.min.js inside a script tag
<script type="application/javascript">
<!-- paste here -->
</script>
The files inside parts/
should be edited.
For the creation of Qs.js
and Qs.min.js
:
make
For the creation of API.md
:
make docgen
For windows users the make win
should be used.
make
rm
,cat
curl
(for windows)markdox
(at npm)