General area when it fits no where else

Moderator: Mmiscool

User avatar
By Luc Volders
#87835 Took me some time to figure it out.
Here you go:

Code: Select all'=========================================================
'working code
'puts a button on screen. Prompts for a variable
'sends variable to basic
'=========================================================

wprint |<body>|
wprint |<button id="btnPrompt" onclick = "sendcode();">Click to give a code</button>|
wprint |<div id="result"></div>|
wprint |<script>|
wprint |function sendcode()|
wprint |{|
wprint |var code = prompt("fill in your value ", "value");|
wprint |var quote = "The value you gave was: " + code;|
wprint |document.getElementById("result").innerHTML = quote;|
wprint |  window.event.returnValue = false;|
wprint |  var xmlHttp = new XMLHttpRequest();|
wprint |  xmlHttp.open("GET", "msg?sendcode=" + code, false);|
wprint |  xmlHttp.send(null);|
wprint |  return xmlHttp.responseText;|
wprint |}|
wprint |</script>|
wprint |</body>|
wprint |</html>|

msgbranch [message]
wait

[message]
    foundcode = msgget("sendcode")
    print "you typed " & foundcode
wait


Luc