有没有办法动态获取函数的函数参数名称?
假设我的函数看起来像这样:
function doSomething(param1, param2, .... paramN){
// fill an array with the parameter name and value
// some other code
}
Run Code Online (Sandbox Code Playgroud)
现在,我如何从函数内部获取参数名称及其值的列表到数组中?
有谁知道如何使用javascript调用服务器端c#方法?我需要做的是在选择取消时停止导入,或者如果选择确定则继续导入.我正在使用visual studio 2010和c#作为我的编程语言
这是我的代码:
private void AlertWithConfirmation()
{
Response.Write(
"<script type=\"text/javascript\">" +
"if (window.confirm('Import is currently in progress. Do you want to continue with importation? If yes choose OK, If no choose CANCEL')) {" +
"window.alert('Imports have been cancelled!');" +
"} else {" +
"window.alert('Imports are still in progress');" +
"}" +
"</script>");
}
Run Code Online (Sandbox Code Playgroud) 我试图读取从我的表单上的WebBrowser控件加载和调用的Javascript变量的值.
例:
index.html引用一个名为'test.js'的javascript.在test.js上,创建并填充了几个变量.
index.html然后调用这个JS.
将加载Index.html并将其显示到WebBrowser控件中.
我已经找到了很多关于如何调用/调用驻留在Web浏览器控件中的函数的帮助.如何轻松读取变量值?