Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BAM: How to embed your program in a web page
#6
I almost wish I was back in the website authoring days again. I've been away from it for about 5 years now, I guess. Anyway, I tried the example code, added a couple of things, and yep, that's what I'm interested in. Use of onclick buttons could control running the code.

Neat how it generates an "image" as a wbpage. The F12 inspect element helps break down the components well enough to see what's going on under the hood. So I tried integrate it a bit with an html doc...

Code: (Select All)
<!DOCTYPE html>
<html>
  <head>
    <script src="https://google.github.io/wwwbasic/wwwbasic.js"></script>
    
  <style>
body {
background-image: url('golf-scorecard.jpg'); width: 100%;
}
div.fixed {
position: fixed;
top: 356px;
left: 156px;
width: 100%;
}
  </style>
</head>
<body>
<div class="fixed">
&nbsp;
<script type="text/basic">
      PRINT "Hello World!"
      COLOR 1, 7
      line input "Hello: "; a$
</script>

</div>
</body>
</html>

Notes: The nbsp; was required to make the divide property work.
The LINE INPUT statement is a bit buggy. I typed to the edge and it left a letter on the right margin on row down as it went back to begin line-2. Behavior continued. Typed 3 lines, but backspace was only able to go back 1 line.

Pete
Reply


Messages In This Thread
RE: BAM: How to embed your program in a web page - by Pete - 11-10-2022, 08:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  BAM Draw CharlieJV 9 1,990 11-07-2023, 10:27 PM
Last Post: James D Jarvis
Star QBJS - General Question for Web Development JamesAlexander 3 961 10-17-2023, 10:42 PM
Last Post: dbox
  BAM programs as "web services": The Pie Chart Service CharlieJV 0 432 09-08-2023, 04:06 AM
Last Post: CharlieJV
  BAM port of an old classic: "Amazing Program" (slightly BAMified) CharlieJV 1 612 08-26-2023, 06:52 PM
Last Post: CharlieJV
  Ported to BAM: David Ahl's "One Check" program ("solitaire checkers") CharlieJV 1 610 08-04-2023, 11:03 PM
Last Post: CharlieJV

Forum Jump:


Users browsing this thread: 1 Guest(s)