如何使用jquery通过ajax发送的电子邮件地址 [英] how to send email address via ajax using jquery
本文介绍了如何使用jquery通过ajax发送的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var emailid='sample@email.com'
var data='email='+emailid;
$.ajax({
type: "POST",
url: "sample.php",
data: data,
dataType: "text",
});
我是通过AJAX发送EMAILID服务器。我是否需要连接code或去code电子邮件ID,同时发送。帮我同时通过AJAX发送电子邮件地址如何连接code和德$ C C是$。
i am sending emailid to server via ajax. whether i need to encode or decode email id while sending. Help me while sending email address via ajax how to encode and decode it.
推荐答案
不要将字符串传递给数据
;使用一个对象,并让jQuery的处理编码:
Don't pass a string to data
; use an object and let jQuery handle the encoding:
var emailid = 'sample@email.com',
data = { email: emailid };
$.ajax({
type: "POST",
url: "sample.php",
data: data,
dataType: "text"
});
请注意,我已删除逗号从的dataType后
使您的通话将工作在IE 6和; 7。
Note that I have removed the comma from after dataType
so that your call will work in IE 6 & 7.
这篇关于如何使用jquery通过ajax发送的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文