Skip to content

Commit

Permalink
javascript example
Browse files Browse the repository at this point in the history
  • Loading branch information
konacurrents committed Nov 11, 2023
1 parent a1d2c0c commit 952fc8a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ embedded in the <a href="smart.js">smart.js</a> code modules.

A typical <b>Http</b> web call looks like the following, passing in a command which includes calls to the appropriate web interface (for example https://SemanticMarker.org/bot/createSemanticMarker as shown in the diagram above).

This is a http GET call, and others are PUSH commands where the payload

```javascript
//! sends the GET command to create a Semantic Marker
function createSemanticMarker(command)
Expand All @@ -56,6 +54,37 @@ function createSemanticMarker(command)

```

### Using the AvatarURL, once retrieved, the following will create the Semantic Marker final image
The commandPath (the Semantic Marker address is a parameter as it the avatarURL, and if the
avatar is circular or rectangle)

```javascript
try
{
getImage(avatarURL).then
(
function (successurl)
{

var sm = new SemanticMarker(document.getElementById(idSM),
commandPath,
avatarURL,
circular);
}).catch (function (errorurl)
{

alert("Issue creating Avatar in Semantic Marker&trade; creation: \n" + errorurl + "\nPlease file bug report");
})

}
catch (error)
{

alert("Issue with Semantic Marker&trade; creation: \n" + error.message + "\nPlease file bug report");
}

```

This is a http GET call. The http PUSH command is also supported where the payload can provide secure information as well as files, such as the Semantic Marker Avatar image.

# Semantic Marker Examples with Avatar Images Embedded
Expand Down
2 changes: 0 additions & 2 deletions smart.html
Original file line number Diff line number Diff line change
Expand Up @@ -7545,8 +7545,6 @@ <h1 class="H1">Semantic Marker&#x2122;</h1>
<p class="label" id="semanticMarkerURLId">url</p>
<br><br>
<br>
<input type="button" class="HELPButton" id="HELPButton" value="?" onClick="alert('Shows the World Wide Feeding Statistics todate')" />
<input type="button" class="OTHERbutton" onClick="invokeURL('https://idogwatch.com/bot/ui/#!/2?socketid=Gyd2JwbXTLu_z_KXAAAA')" value="Feeding Statistics"/>

<br><br>
<img src="https://KnowledgeShark.me/images/KCNewLabel600-small.png" width="500"></a>
Expand Down

0 comments on commit 952fc8a

Please sign in to comment.