【ajax】jquery.ajax上传文件

Continue Read..

Simple HTML

<input type="file" id="one-specific-file" name="one-specific-file">

Use as little as

$('#one-specific-file').ajaxfileupload({
  action: '/upload.php'
});

or as much as

$('input[type="file"]').ajaxfileupload({
  action: '/upload.php',
  valid_extensions : ['md','csv'],
  params: {
    extra: 'info'
  },
  onComplete: function(response) {
    console.log('custom handler for file:');
    alert(JSON.stringify(response));
  },
  onStart: function() {
    if(weWantedTo) return false; // cancels upload
  },
  onCancel: function() {
    console.log('no file selected');
  }

});

参考网址 https://github.com/jfeldstein/jQuery.AjaxFileUpload.js

jquery.ajaxfileupload.zip

【jquery】单选框选中事件

Continue Read..
$(function(){
$("input[name='level']").click(function(){
console.log(123);
getPriceAndRatio($('input[name="level"]:checked').val(), 0, 0);
});
});

声明:此文系舞林cuznwww.wulinlw.org)原创稿件,转载请保留版权