ajax html send,Use AJAX to send html5 textarea directly without html | 易学教程
发布日期:2021-10-27 11:21:04 浏览次数:8 分类:技术文章

本文共 1249 字,大约阅读时间需要 4 分钟。

问题

Recently I am confused about whether it's possible to send input/textarea data directly without being included in html < form >. I thought in web page, if we want to get information from user then send the text to authentication server, we must use < form > irrespective of in which way it's submitted.

But an anonymous reviewer of my paper claims that < html > can be bypassed by using an html5 tag "textarea" and JS AJAX post. While I did lots of experiments trying to implement his way but all failed.

I wonder if there is really some way to submit user info without using < form > tag?

Thank you

----------------------------------------------------------------------------------------------------------

Thanks for everyone's reply.

Update: I followed "the_void"'s code and changed the url of AJAX to a ServerSocket (implemented by Java). The server was able to get the POST event, but it cannot read the "data" of AJAX. The following is the html code:

HTML

$(document).ready(function() {

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

//information to be sent to the server

info = $('#foo').val();

$.ajax({

type: "POST",

url: 'http://10.0.0.3:8888',

data: ({foo: info}),

//crossDomain: true,

//dataType: 'json'

});

return false;

});

});

Text

Submit via Ajax

转载地址:https://blog.csdn.net/weixin_34518190/article/details/117973959 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:计算机英语二国家线,历年考研英语二国家线
下一篇:html 每个选项后面加个删除,jQuery.html()将删除选择选项的所选属性

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年03月31日 06时14分16秒