相关疑难解决方法(0)

我可以在Node.js中使用jQuery吗?

是否可以使用Node.js在服务器端使用jQuery选择器/ DOM操作?

javascript jquery node.js

556
推荐指数
12
解决办法
34万
查看次数

浏览器何时会抛出$ .ajaxSetup不是函数错误

我正在尝试在我的JSP文件中插入以下代码段

{
    $.ajaxSetup({
        cache: false,
        async: false
    });
    var ajax_load = "loading data please wait...";
    var loadUrl = "abc.jsp";

    $("#seoarea").html(ajax_load).load(loadUrl, {
        param1: holdvalue1,
        param2: holdvalue2
    });
}
Run Code Online (Sandbox Code Playgroud)

在mozilla firfox上运行此命令时,抛出“ $ .ajaxSetup不是函数”错误。

ajax jquery

3
推荐指数
2
解决办法
7027
查看次数

如何通过ajax打开弹出对话框窗口并保存数据.net core mvc

我是 .NET 新手,我想打开一个模式弹出窗口,然后将此数据保存到数据库而不重新加载页面。

首先,用户需要单击一个按钮。Modal是通过ajax加载的。用户填写表格,然后内容经过验证并发布到数据库中。

这是按钮的代码:

<button class="btn btn-primary" asp-controller="Positions" asp-action="Create" 
        data-toggle="ajax-modal" data-target="#add-contact">Add new Positions</button>
Run Code Online (Sandbox Code Playgroud)

这是控制器:

// GET: Positions/Create
public IActionResult Create()
{
    return View();
}

// POST: Positions/Create
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create([Bind("PositionId,PositionName")] Position position)
{
    if (ModelState.IsValid)
    {
        _context.Add(position);
        await _context.SaveChangesAsync();
        return RedirectToAction(nameof(Index));
    }
    return View(position);
}
Run Code Online (Sandbox Code Playgroud)

这是模型(很简单)

public class Position
{
    [Key]
    public int PositionId { get; set; }
    public string PositionName { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

这是我的观点的代码:

@model Models.Position

@{
    ViewData["Title"] = "Create";
}

<h3>Create Position</h3> …
Run Code Online (Sandbox Code Playgroud)

.net javascript ajax jquery asp.net-core

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

标签 统计

jquery ×3

ajax ×2

javascript ×2

.net ×1

asp.net-core ×1

node.js ×1