Browser Widget JavaScript pass parameters

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Browser Widget JavaScript pass parameters

Post by AndyP » Mon Mar 19, 2018 10:49 am

If you have the JavaScript in a browser widget "Browser1" for example,

1. how would you pass the parameters/variables a and b to the script
2. how would you get the value x back from the script

<!DOCTYPE html>
<html>
<body>

<p>A typical arithmetic operation takes two numbers (or variables) and produces a new number.</p>

<p id="demo"></p>

<script>
var a = 100;
var b = 50;
var x = a + b;
document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”