使用ajax POST传递数据

时间:2016-08-17 22:32:00

标签: javascript ajax node.js reactjs

action="{% url 'create_recipe_rule' recipe_id %}"

尝试使用我的node.js服务器访问它时,会抛出错误,指示标记未定义

submit() {
    $.ajax({
        url: 'http://localhost:5000/data',
        type: 'POST',
        data: JSON.stringify({ Markers: 'heleeo' }),
        contentType: "application/json",
        dataType: 'json',
        success: (data) => {
            alert(data);
        },
        error: () => {
            console.log('wrong');
        }
    });

}

0 个答案:

没有答案