Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在jquery中设置配置值?_Jquery - Fatal编程技术网

如何在jquery中设置配置值?

如何在jquery中设置配置值?,jquery,Jquery,我想在jQuery中用config值设置url字段。我的代码是 $.ajax({ type: 'POST', url: "<%= Config.GetInstanceConfig("WS_OtherInstanceURL")%>", data: "json", }); $.ajax({ 键入:“POST”, url:“”, 数据:“json”, }); 但是我没有从我的配置文件中获取URL值。您可以在隐藏控件中设置URL的配置值

我想在jQuery中用config值设置url字段。我的代码是

    $.ajax({
    type: 'POST',
    url: "<%=  Config.GetInstanceConfig("WS_OtherInstanceURL")%>",
        data: "json",
     });
$.ajax({
键入:“POST”,
url:“”,
数据:“json”,
});

但是我没有从我的配置文件中获取URL值。

您可以在隐藏控件中设置URL的配置值,如下所示

<input type="hidden" id="configURLValue" value='<%=  Config.GetInstanceConfig("WS_OtherInstanceURL")%>'>

这很有效

这是什么服务器端语言?
var hiddenFieldValue = $("#configURLValue").val();
 $.ajax({
type: 'POST',
url: hiddenFieldValue,
    data: "json",
 });