Share your advanced knowledge/code with the community.
User avatar
Peter
 
Posts: 479
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Module: jQuery

by Peter Fri Sep 22, 2017 3:51 pm

Hello,

here is a module that eases the handling of jQuery:

https://github.com/spiderbytes/jQuery

Example:
Code: Select all
IncludeFile "jQuery.sbi"

UseModule jQuery
 
  Define Table, TableRow, TableCell
  Define rowCounter, cellCounter
 
  Table = Element("<table />") ; Create a table element
 
  SetAttribute(Table, "border", "1") ; set the border attribute
 
  SetCSS(Table, "background-color", "white") ; set the background-color to white
 
  SetCSS(Table, "position", "absolute") ; set the position...
  SetCSS(Table, "top", "100px")
  SetCSS(Table, "left", "100px")
 
  For rowCounter = 0 To 9 ; let's create 10 table rows
   
    TableRow = Element("<tr />") ; create a table row element
   
    For cellCounter = 0 To 9 ; let's create 10 table cells per row
     
      TableCell = Element("<td />") ; create a table cell element
     
      SetText(TableCell, "Row " + rowCounter + " / Cell " + cellCounter) ; write some text into the cell
     
      Append(TableRow, TableCell) ; append the new cell element to the current row element
     
    Next
   
    Append(Table, TableRow) ; append the new row element to the table element
   
  Next
 
  Body = Element("Body") ; get the body element
 
  Append(Body, Table) ; and append the table element to the body element
 
UnuseModule jQuery


Greetings ... Peter
Return to Tricks 'n' Tips

Who is online

Users browsing this forum: No registered users and 1 guest