希望将变量从 c# 传递到 javascript 以使用一些 jquery 代码。传递双精度、整数、字符串、数组。有谁知道如何做到这一点?
例如,如果我在 c# 中有这个代码片段:
string blah = "this is a blah string";
我想将它传递给 javascript,以便我可以在 jquery 中使用鼠标悬停事件:
$('#myDiv').mouseover(function(){ //do something with my 'blah' string });