I'm trying with wechat miniprogram for the first time and believe its still web pages but with its own tag (and handling).
I'm trying to do something like this:
<view class="btns">
<button bindtap="getWeather('New York')">New York</button>
<button bindtap="getWeather('Toronto')">Toronto</button>
</view>
IE for the web page buttons, I want to call the getWeather
function, but different buttons will pass different parameters to the function.
How can I do it in wechat miniprogram and also html/javascript in general as well please?
UPDATE:
My code in theory should work with html/javascript in general, like:
- https://www.w3schools.com/js/tryit.asp?filename=tryjs_function2, or
- https://stackoverflow.com/a/38632590/2125837
So this question only limits to wechat miniprogram then.