How can I call a javascript function and pass some variables to be used as parameters for instance
Say the function javascriptFunction
uses 2 parameter. I will usually call it as javascriptFunction("param1", "param2")
(with single quotes around the strings). But now I want to pass it some variables.
string y = "this is a string"
string x = "another"
javascriptFunction(y, x)
I have tried javascriptFunction(@y, @x)
, javascriptFunction("@y", "@x") (with single and then double quotes around the strings) but this does not work
EDIT I am actually making the call through a view (cshtml file). So my variables are strings.