简体   繁体   中英

Can I somehow use a Java variable in JavaScript?

我的活动中有一个名为pitchInHz的变量,我想在JS函数中使用它来将其与那里的变量进行比较。

You can use Java variables in Javascript code.

Here is how.

<script> 
  var java2Js = <%= pitchInHz %>

 // you can do any JS code here

</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM