相关疑难解决方法(0)

使用jQuery提交表单

我想使用jQuery提交表单.有人可以提供代码,演示或示例链接吗?

jquery

460
推荐指数
18
解决办法
106万
查看次数

jQuery发布JSON

更新:我想传递var value给服务器

你好,同样老,同样老...... :)

我有一个名为的表单<form id="testForm" action="javascript:test()">和一个名为的代码区域<code id="testArea"></code>

我正在使用此代码在代码区域中字符串化并显示数据:

var formData = form2object('testForm');
document.getElementById('testArea').innerHTML = JSON.stringify(formData, null, '\t');
var value = JSON.stringify(formData, null, '\t');
Run Code Online (Sandbox Code Playgroud)

我想要的是将此数据发送到JSON文件.我一直在研究这个项目:http://ridegrab.com/profile_old/如果按下Submit Query按钮,你会看到页面的头部填充.

另外我想用这段脚本发送数据:

    function authenticate(userName, password) {
    $.ajax
    ({
        type: "POST",
        //the url where you want to sent the userName and password to
        url: 'username:password@link to the server/update',
        dataType: 'json',
        async: false,
        //json object to sent to the authentication url
        data: '{"userName": "' + userName …
Run Code Online (Sandbox Code Playgroud)

jquery post json

178
推荐指数
2
解决办法
35万
查看次数

标签 统计

jquery ×2

json ×1

post ×1