Sheerpower Logo
N.3  Browser Scripting

Dynamic Web Development

sheerpower can be using as a browser scripting language. The first step is to activate the sheerpower InterNet Services Web Server SPINS_WEBSERVER, also referred to as the spins webserver:
C:>spins_webserver sheerpower InterNet Services Web Server SPINS_WEBSERVER V10.135 Copyright (c) 2005-2022 Touch Technologies, Inc. - Thu, 20 Jun 2024 21:19:50 Listening IP address is 0.0.0.0 Spoofed>> "Server: Apache/2.4.52 (Ubuntu)" Port 4, wwwroot is C:\sheerpower\sphandlers\wwwroot\ Port 80, wwwroot is C:\sheerpower\sphandlers\wwwroot\
The spins webserver has a lot of startup options. They can be seen by:
spins_webserver -?

On some systems, Windows might ask if it is okay if the spins_webserver accesses the network. Choose yes to continue.

To test that spins is working, type this url into your browser's address bar:
http://localhost/

The browser will respond with:
You made it to the SPINS_WEBSERVER index.html To change the default root folder (for example to c:\inetpub\wwwroot) c:> \sheerpower\sphandlers\spins_webserver -wwwroot c:\inetpub\wwwroot

Let's run our first sheerpower script. The source code is in C:\sheerpower\sphandlers\scripts\sp4gl,
and the program is called:
matrix.spsrc. To run it, use this url:
localhost/matrix.spsrc
When sheerpower code is run as a script, anything between double brackets is code, all else is html.

Explanation of [[ ]] Syntax in sheerpower

The [[ ]] syntax in sheerpower is used to embed sheerpower code within an HTML document. This allows you to mix server-side logic with client-side HTML seamlessly.

How it Works

  • Opening and Closing [[ ]]:

    Code enclosed within [[ ]] is interpreted and executed as sheerpower code. This syntax helps distinguish between HTML content and sheerpower code.

  • Usage in HTML:

    You can use [[ ]] to include loops, conditionals, and other logic directly within your HTML. This is useful for generating dynamic content based on server-side processing.

Benefits

  • Dynamic Content: Easily generate dynamic content based on server-side processing.
  • Seamless Integration: Mix HTML and sheerpower code without switching contexts.
  • Flexibility: Use loops, conditionals, and other logic within HTML to create flexible and powerful web pages.

This feature is particularly useful in creating dynamic and interactive web applications, where the content can be generated and manipulated server-side before being sent to the client.


Below is the HTML code mixed with sheerpower code.

Note: This code for matrix.spsrc is only runnable from your local computer, inside of your browser.
Hide Description

    

       


      

Enter or modify the code below, and then click on RUN

Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use.
Wide screen