$(document).ready(function ()
{
var options = {
beforeSubmit: showRequest,
success: showResponse,
dataType: 'json',
clearForm: true,
error: function (request, message, ex)
{
alert('错误:' + message);
}
};
$('#qrForm').ajaxForm(options);
});
function showRequest(formData, jqForm, options)
{
return true;
}
function showResponse(responseText, statusText, xhr, $form)
{
if (responseText[0].count == 0)
{
alert(responseText[0].list[0].error);
return false;
}
$("#img_qr").attr("src", responseText[0].list[0].imgurl);
$("#txt_readqr").val(responseText[0].list[0].qrtext);
return false;
ASP.NET实现二维码(QRCode)的创建和读取实例(2)
内容版权声明:除非注明,否则皆为本站原创文章。