小编Fer*_*ehy的帖子

使用JQuery Ajax发布数组导致MVC中的500(内部服务器错误)

我有这样一个数组:

var nums=["21", "22", "23", "20", "19", "18"];
Run Code Online (Sandbox Code Playgroud)

和这个JQuery Ajax代码:

 $('#chk').click(function () {

    $.ajax({
        url: "/BarberShop/ServiceUpdate",
        type: "Post",
        data:{ nums: nums},
        dataType: "json",
        success: function (data) {
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

和控制器动作如下:

    [HttpPost]
    public ActionResult ServiceUpdate(string nums)
    {
      //Do something......
        return View();
    }
Run Code Online (Sandbox Code Playgroud)

问题是当我nums在Controller Action中使用ajax 参数发布数组时null,服务器也给我这个错误:

POST http:// localhost:18322/BarberShop/ServiceUpdate 500(内部服务器错误)

n.ajaxTransport.k.cors.a.crossDomain.send @jquery-2.1.4.min.js:4n.extend.ajax @jquery-2.1.4.min.js:4(匿名函数)@ Barbershop:481n. event.dispatch @jquery-2.1.4.min.js:3n.event.add.r.handle @jquery-2.1.4.min.js:3

我在这个链接和其他一些方面尝试了所有答案:

500内部服务器错误 - 上的jQuery的Ajax-后ASP净MVC

传递阵列到AJAX请求功能于AJAX

但仍然有问题.谢谢

javascript php ajax asp.net-mvc jquery

4
推荐指数
1
解决办法
5203
查看次数

Css 或 Jquery 中图像上的动画光反射

看看下面的图片:

在此处输入图片说明

我需要为图像上的白光反射设置动画,以从图像的右侧进入并从图像的左侧出去。我对 SVG 做了一些这样的效果:

<div class="wrapper_1">
<img src="../images/stone.png"/>
<svg width="1600" height="600" viewBox="0 0 1600 600">
    <filter id="demo1">
        <feGaussianBlur stdDeviation="3" result="blur4"/>
        <!--Lighting effect-->
        <feSpecularLighting result="spec4" in="blur4" specularExponent="35" lighting-color="#cccccc">
            <!--Light source effect-->
            <fePointLight x="75" y="100" z="200">
                <!--Lighting Animation-->
                <animate attributeName="x" values="75;320;75" dur="10s" repeatCount="indefinite"/>
            </fePointLight>
        </feSpecularLighting>
        <!--Composition of inputs-->
        <feComposite in="SourceGraphic" in2="spec4" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/>
    </filter>
    <filter id="demo2">
        <feGaussianBlur in="SourceGraphic" stdDeviation="2" result="blur5"/>
        <!--Composition of inputs-->
        <feComposite in="SourceGraphic" in2="blur5" operator="arithmetic" k1="0" k2="3" k3="3" k4="0"/>
    </filter>
    <!--Apple tree graphic-->
    <g class="tree" filter="url(#demo4)">
        <g> …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery css-animations

3
推荐指数
1
解决办法
3114
查看次数

标签 统计

javascript ×2

jquery ×2

ajax ×1

asp.net-mvc ×1

css ×1

css-animations ×1

html ×1

php ×1