- thinkphp ajax路径问题,thinkphp框架ajax返回问题 | 严佳冬
李创奇
thinkphpajax路径问题
前天发布了自己写的博客系统YBlog的第一个版本,后台在上传图片的时候并没有使用Ajax请求,在更新下一个版本的时候打算使用上传ajax请求,但是thinkphp框架自带的ajaxReturn方法返回的并不是我所需要的json对象,看下图:视图中的代码是这样的:$("#upload").ajaxfileupload({'action':'__CONTROLLER__/uploadAjax','pa
- laravel-ajaxfileupload上传图片并保存到服务器本地文件夹
做个优秀的代码搬运工
使用框架:laravel+layui插件地址:ajaxfileupload.js若失效自行百度laravel图片处理插件:【扩展推荐】Intervention/image图片处理JS代码//添加汽修厂$(".addShop").click(function(){varparams={};params.shop_fileimg=$('#shopImg').val();params.shop_file
- input输入框file类型第二次不触发onchange事件
jianghaha2011
js前端javascripthtml5
input输入框file类型第二次不触发onchange事件的根本原因:原来是ajaxFileUpload插件造成的,它会把原来的file元素替换成新的file元素,所以之前绑定的change事件就失效了。上传时,当第二次点击同一个文件,由于value值没有发生变化,无法触发change/onchange事件。所以,问题的关键是input的value值,只需要在选择一次后将input标签的valu
- ajaxFileUpload 异步上传文件简单使用
小林望北
WEB开发ajaxfileuploaduploadajax
Inserttitlehere$(function(){//点击打开文件选择器$("#upload").on('click',function(){$('#fileToUpload').click();});//选择文件之后执行上传$('#fileToUpload').on('change',function(){$.ajaxFileUpload({url:'../FileUploadServle
- ajaxFileUpload上传文件时,自定义参数data后台获取为null的问题
lifeisfloat
ajaxFileUpload自定义参数,后台获取的时候为null解决办法:修改ajaxFileUpload.js文件中createUploadForm()函数,新增传入参数data,并创建hidden控件,存储自定义参数createUploadForm:function(id,fileElementId,data){....if(data){for(variindata){$('').append
- ajaxfileupload struts2 null_去掉烦人的 “ ! = null " (判空语句)
weixin_39590739
ajaxfileuploadstruts2nullcurl_execreturnnullevalastringwithnullhiveif语句htmlif语句isnull优化
来自:CSDN作者:lizeyang原文链接:blog.csdn.net/lizeyang/article/details/40040817问题为了避免空指针调用,我们经常会看到这样的语句...if(someobject!=null){someobject.doCalc();}...最终,项目中会存在大量判空代码,多么丑陋繁冗!如何避免这种情况?我们是否滥用了判空呢?精华回答:这是初、中级程序猿经
- js文件夹上传到服务器,js 上传img到服务器
物理老卢
js文件夹上传到服务器
jQuery插件之ajaxFileUpload前端视图,HTML与JS代码,成功上传后,返回图片真实地址并绑定到的SRC地址lt;head>lt;scriptsrc="/jquery-1.7.1.js"type="text/javascript">lt;script>lt;scriptsrc="/...文章wenvi_wu2015-01-031318浏览量jQuery插件之ajaxFileUplo
- JAVA利用FTP文件服务器上传的记录.
不规则颜色
后台管理
首先:一个基础简单的上传页面,异步上传.注意-->使用的是ajaxfileupload.js,需要下载.最基础页面准备:FTP测试选择资源后,点击按钮上传上传functionajaxFileUpload(){alert("----------");$.ajaxFileUpload({url:'http://192.168.0.226:8086/admin/test/uploadFile.do',/
- JQuery的AJAX与Spring MVC实现异步文件上传
河马开源
更多文章请进入:我的开源网需要:ajaxfileupload.js包jquery包这里还用到了jqueryeasyuiaction代码:packagecom.cjh.action;importjava.io.File;importjava.util.UUID;importjavax.servlet.http.HttpServletRequest;importorg.springframework.
- 通过ajaxFileUpload异步请求上传文件(ajaxFileUpload+servlet实现文件上传下载)
雾林小妖
JavaScripthtml5htmljavajavascriptajax
1、最终效果实现选择图片(此处以图片为例,支持所有类型文件的上传),选择之后将选择的图片在页面中显示出来,点击上传,可以将文件上传到指定的地址中,上传成功后在当前页面自动显示下载标签。源码下载地址:链接:https://pan.baidu.com/s/17G63S9rkfFIfGBqwCwUHaA提取码:52b72、技术结构eclipse+servlet+ajaxFileUpload+window
- ajaxfileupload+bootstrap-fileupload.js实现文件上传bug修复总结
我是7788
今天下修改了一个bug是ajaxfileupload+bootstrap-fileupload.js实现文件上传,由于ajaxFileUpload把原来的file元素替换成新的file元素造成bootstrap-fileupload.js组件失效,在此记录一下:以下是标准的实现方式:----------------------------------------------------1.ajax
- 使用ajaxFileUpload上传文件流至服务器,同时提交多个参数
ssg-123
服务器文件ajaxfileuploa
1.前端界面引入如下两个js文件,注意引入顺序,因为ajaxfileupload会用到jquery,所以jquery应该先引入申请单号:合同文件:2.修改ajaxfileupload.js成如下jQuery.extend({createUploadIframe:function(id,uri){//createframevarframeId='jUploadFrame'+id;if(window.
- 常用的两种ajax上传文件的方式
fenglingcompany
web前台javascriptjsonjavaViewUI
一,ajaxfileuploadfunctiongetValue(){document.getElementById('appFilename').value=document.getElementById('appFile').value;validateImage();ajaxFileUpload();}functionajaxFileUpload(){/*$("#loading").ajax
- Thinkphp结合ajaxFileUpload实现ajax异步图片传输全套代码
目录1、引用文件2、HTML代码3、JS代码4、后台处理(PHP)5、前台调用这篇文章主要给大家介绍了利用Thinkphp结合ajaxFileUpload实现异步图片传输的方法,文中给出了详细的示例代码,对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。使用Jquery的ajaxFileUpload的图片上传插件,感觉这种异步上传的方式非常好用接下来就介绍一下这个插件的使用。通过查看插件的源
- 使用JQuery ajaxFileUpload.js上传文件踩坑记录
杳杳靈鳯
前言最近在做前端的时候要实现文件上传的功能,用了form和jquery的ajax传值效果都不理想,最后采用了ajaxFileUpload.js这个前端脚本来实现。在使用的时候遇到了几个坑,一路摸着石头过河,也算是解决了问题,遂记录下来。这个功能在实际工作种经常用到,希望能给需要做这方面的人有些帮助。ajaxFileUpload.js有很多同名的,网上很好找到。我附上一个我使用的版本。https:/
- asp.net使用ajaxFileUpload插件上传文件(附源码)
ajaxFileUpload.js很多同名的,因为做出来一个很容易。我用的是这个:https://github.com/carlcarl/AjaxFileUpload下载地址在这里:http://xiazai.jb51.net/201701/yuanma/ajaxfileupload(jb51.net).rarAjaxFileUpload.js并不是一个很出名的插件,只是别人写好的放出来供大家用,
- ajax实现图片的回显功能
一只Java小白1111
javaWebjavaajaxjavascript
前端页面给文件上传域绑定一个改变事件图片介绍选择图片后通过ajax发送请求到服务端,把图片进行存储并且返回json数据,使得图片回显functionfileChange(){$.ajaxFileUpload({url:"${pageContext.request.contextPath}/prod/ajaxImg.action",secureuri:false,fileElementId:'pim
- 异步上传
九思而行
网上有很多异步上传的插件,但是正好找到了这个资源在就这说明一下。网上很多ajaxfileupload.js,但是我在下载使用之后总是有这样或那样的问题,就想先把这放在这圣诞以后找了,不多说直接上代码。引入jquery和ajaxfileupload.jshtmljs$.ajaxFileUpload({url:"addProject",type:'post',data:{form_qvyv:$("#f
- AjaxFileUpload实现文件上传
滴雨幻想
此例为maven项目,实现学生模块中简历的上传操作。所用框架为SSM框架。此处将下载文件、删除文件的方法统一展示,因为这是上传配套的功能,不作另外阐述。AjaxFileUpload.js文件可在百度自行下载,下载后放入项目中,并在页面中引用即可。1.JSP构建一个隐藏的文件域,当点击上传简历时,模拟点击文件域,弹窗文件选择框;下载文件仅是做了一个超链接,指向后台下载请求地址,同时将fileId作为
- Web端裁剪图片方法
流云
由于在Web端,JavaScript不能直接处理本地文件,因此可以在后台裁剪图片,或者利用html5的canvas来处理。方法1:传送到后台剪切步骤1:上传图片到后台,向前端返回图片URL利用input标签,将文件发送到后台。可以使用jQuery中的ajaxFileUpload方法$.ajaxFileUpload({url:'live/apply/uploadImage',//用于文件上传的服务器
- jquery实现异步文件上传ajaxfileupload.js
本文实例为大家分享了jquery实现异步文件上传的具体代码,供大家参考,具体内容如下ajaxfileupload.js异步上传文件:直接引用。调用方法:$.ajaxFileUpload({url:'',//后台接口地址type:"post",secureuri:false,//一般设置为falsefileElementId:'ofx',//上传文件的id、name属性名dataType:'json
- ajaxfileupload 异步下载文件
a_good_job
@ResponseBody@RequestMapping(value="ajaxFileUpload",method={RequestMethod.POST,RequestMethod.GET})publicStringajaxFileUpload(Modelmodel,HttpServletResponseresponse,@RequestParamMultipartFilemyfile,Htt
- 在linux上创建nfs遇到的问题。
渭水飞熊
Linux
我们部署程序时,图片服务器是单独的一台服务器,有自己独立的域名。而应用部署在另一台服务器上,我们使用一些附件上传工具,比如ajaxfileupload上传附件时是无法跨域访问的。之前想的方案是,先上传到应用所在的服务器,然后使用java的ftp组件上传到图片服务器上(当然了,图片服务器上安装了ftp服务端)。可是后来发现ftp上传比较慢而且不稳定,决定换成NFS来解决这个问题,当然了这个方案到底是
- ajaxFileUpload.js 无刷新上传图片,支持多个参数同时上传,支持 ie6-ie10
草青工作室
JQueryJavascript
ajaxFileUpload无刷新上传的原理:在页面动态创建form表单和ifram贞,设定form表单提交的目标为ifram贞,将文件域和要post的参数动态写入form表单中,然后提交from表单。通过window.attachEvent向ifram贞的onload事件中注册监听事件响应回调函数。1.html部分2.调用部分functionuploadImg(imgfileId,imgcont
- ajaxfileupload.js
Jon_jing
日常编程js
-------请注意,,不是原创,是我转载,但是不记得转载链接了,仅供使用谢谢,如果有知道转载出处的,请联系我----jQuery.extend({createUploadIframe:function(id,uri){//createframevarframeId='jUploadFrame'+id;variframeHtml='';jQuery(iframeHtml).appendTo(doc
- 关于前端html图片和文件上传和后台接收方法
第五轻轻
web前端java
前些时间项目和h5交互时涉及到了文件上传的一个功能,但是h5在写上传的时候总是上传不上,所以花时间专门看了下web端的文件上传记录下。第一种是前端写的,拿来修改了下,这种方法在上传的时候需要用到jquery.js和ajaxfileupload.js://获取图片本地urlfunctiongetObjectURL(file){varurl=null;if(window.createObjectURL
- jQ基础篇--jQuery插件ajaxfileupload.js源码与使用
weixin_34221036
jsonjavascript
在网页应用中,一般会用到上传文件或者图片什么的到服务器,那么可以用ajaxfileupload.js,但是在使用ajaxfileupload.js时候,当服务器返回的json带有&符号的时候,返回的data数据里面所有的&被转义成了&。下面的ajaxfileupload.js是经过修改的文件上传库。jQuery.extend({/**createUploadIframe创建上传的ifram
- ajaxfileupload文件上传返回值处理 ajaxfileupload.js + spring mvc文件上传
兴哥-bling
JavaScript
ajaxfileupload.js组件的确好用,但是那个返回值格式也太恶心了吧!让人家定义一个dataType:"json",最后给返回一堆html,什么意思?也许是鄙人愚钝,索性修改了下源代码的处理函数,手动返回json得了。修改代码:大约在ajaxfileupload.js的185行左右,有这么个函数:uploadHttpData原始代码与改后代码对比:uploadHttpData:funct
- 使用ajaxfileupload.js实现上传文件功能
徐小妖
java
一、ajaxFileUpload是一个异步上传文件的jQuery插件。语法:$.ajaxFileUpload([options])options参数说明:1、url上传处理程序地址2、fileElementId文件选择框的id属性,即的id3、secureuri是否启用安全提交,默认为false4、dataType服务器返回的数据类型。可以为xml,script,json,html。如果不填写,j
- jQuery插件AjaxFileUpload实现ajax文件上传
余_小凡
JQUERY
jQuery插件AjaxFileUpload用来实现ajax文件上传,该插件使用非常简单,接下来写个demo演示怎么用AjaxFileUpload插件实现文件上传。1、引入AjaxFileUpload插件相关的jsresources/js/jquery-1.2.1.js">resources/js/ajaxfileupload.js">备注:测试发现,ajaxfileupload对jQuery版本
- PHP如何实现二维数组排序?
IT独行者
二维数组PHP排序
二维数组在PHP开发中经常遇到,但是他的排序就不如一维数组那样用内置函数来的方便了,(一维数组排序可以参考本站另一篇文章【PHP中数组排序函数详解汇总】)。二维数组的排序需要我们自己写函数处理了,这里UncleToo给大家分享一个PHP二维数组排序的函数:
代码:
functionarray_sort($arr,$keys,$type='asc'){
$keysvalue= $new_arr
- 【Hadoop十七】HDFS HA配置
bit1129
hadoop
基于Zookeeper的HDFS HA配置主要涉及两个文件,core-site和hdfs-site.xml。
测试环境有三台
hadoop.master
hadoop.slave1
hadoop.slave2
hadoop.master包含的组件NameNode, JournalNode, Zookeeper,DFSZKFailoverController
- 由wsdl生成的java vo类不适合做普通java vo
darrenzhu
VOwsdlwebservicerpc
开发java webservice项目时,如果我们通过SOAP协议来输入输出,我们会利用工具从wsdl文件生成webservice的client端类,但是这里面生成的java data model类却不适合做为项目中的普通java vo类来使用,当然有一中情况例外,如果这个自动生成的类里面的properties都是基本数据类型,就没问题,但是如果有集合类,就不行。原因如下:
1)使用了集合如Li
- JAVA海量数据处理之二(BitMap)
周凡杨
java算法bitmapbitset数据
路漫漫其修远兮,吾将上下而求索。想要更快,就要深入挖掘 JAVA 基础的数据结构,从来分析出所编写的 JAVA 代码为什么把内存耗尽,思考有什么办法可以节省内存呢? 啊哈!算法。这里采用了 BitMap 思想。
首先来看一个实验:
指定 VM 参数大小: -Xms256m -Xmx540m
- java类型与数据库类型
g21121
java
很多时候我们用hibernate的时候往往并不是十分关心数据库类型和java类型的对应关心,因为大多数hbm文件是自动生成的,但有些时候诸如:数据库设计、没有生成工具、使用原始JDBC、使用mybatis(ibatIS)等等情况,就会手动的去对应数据库与java的数据类型关心,当然比较简单的数据类型即使配置错了也会很快发现问题,但有些数据类型却并不是十分常见,这就给程序员带来了很多麻烦。
&nb
- Linux命令
510888780
linux命令
系统信息
arch 显示机器的处理器架构(1)
uname -m 显示机器的处理器架构(2)
uname -r 显示正在使用的内核版本
dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI)
hdparm -i /dev/hda 罗列一个磁盘的架构特性
hdparm -tT /dev/sda 在磁盘上执行测试性读取操作
cat /proc/cpuinfo 显示C
- java常用JVM参数
墙头上一根草
javajvm参数
-Xms:初始堆大小,默认为物理内存的1/64(<1GB);默认(MinHeapFreeRatio参数可以调整)空余堆内存小于40%时,JVM就会增大堆直到-Xmx的最大限制
-Xmx:最大堆大小,默认(MaxHeapFreeRatio参数可以调整)空余堆内存大于70%时,JVM会减少堆直到 -Xms的最小限制
-Xmn:新生代的内存空间大小,注意:此处的大小是(eden+ 2
- 我的spring学习笔记9-Spring使用工厂方法实例化Bean的注意点
aijuans
Spring 3
方法一:
<bean id="musicBox" class="onlyfun.caterpillar.factory.MusicBoxFactory"
factory-method="createMusicBoxStatic"></bean>
方法二:
- mysql查询性能优化之二
annan211
UNIONmysql查询优化索引优化
1 union的限制
有时mysql无法将限制条件从外层下推到内层,这使得原本能够限制部分返回结果的条件无法应用到内层
查询的优化上。
如果希望union的各个子句能够根据limit只取部分结果集,或者希望能够先排好序在
合并结果集的话,就需要在union的各个子句中分别使用这些子句。
例如 想将两个子查询结果联合起来,然后再取前20条记录,那么mys
- 数据的备份与恢复
百合不是茶
oraclesql数据恢复数据备份
数据的备份与恢复的方式有: 表,方案 ,数据库;
数据的备份:
导出到的常见命令;
参数 说明
USERID 确定执行导出实用程序的用户名和口令
BUFFER 确定导出数据时所使用的缓冲区大小,其大小用字节表示
FILE 指定导出的二进制文
- 线程组
bijian1013
java多线程threadjava多线程线程组
有些程序包含了相当数量的线程。这时,如果按照线程的功能将他们分成不同的类别将很有用。
线程组可以用来同时对一组线程进行操作。
创建线程组:ThreadGroup g = new ThreadGroup(groupName);
&nbs
- top命令找到占用CPU最高的java线程
bijian1013
javalinuxtop
上次分析系统中占用CPU高的问题,得到一些使用Java自身调试工具的经验,与大家分享。 (1)使用top命令找出占用cpu最高的JAVA进程PID:28174 (2)如下命令找出占用cpu最高的线程
top -Hp 28174 -d 1 -n 1
32694 root 20 0 3249m 2.0g 11m S 2 6.4 3:31.12 java
- 【持久化框架MyBatis3四】MyBatis3一对一关联查询
bit1129
Mybatis3
当两个实体具有1对1的对应关系时,可以使用One-To-One的进行映射关联查询
One-To-One示例数据
以学生表Student和地址信息表为例,每个学生都有都有1个唯一的地址(现实中,这种对应关系是不合适的,因为人和地址是多对一的关系),这里只是演示目的
学生表
CREATE TABLE STUDENTS
(
- C/C++图片或文件的读写
bitcarter
写图片
先看代码:
/*strTmpResult是文件或图片字符串
* filePath文件需要写入的地址或路径
*/
int writeFile(std::string &strTmpResult,std::string &filePath)
{
int i,len = strTmpResult.length();
unsigned cha
- nginx自定义指定加载配置
ronin47
进入 /usr/local/nginx/conf/include 目录,创建 nginx.node.conf 文件,在里面输入如下代码:
upstream nodejs {
server 127.0.0.1:3000;
#server 127.0.0.1:3001;
keepalive 64;
}
server {
liste
- java-71-数值的整数次方.实现函数double Power(double base, int exponent),求base的exponent次方
bylijinnan
double
public class Power {
/**
*Q71-数值的整数次方
*实现函数double Power(double base, int exponent),求base的exponent次方。不需要考虑溢出。
*/
private static boolean InvalidInput=false;
public static void main(
- Android四大组件的理解
Cb123456
android四大组件的理解
分享一下,今天在Android开发文档-开发者指南中看到的:
App components are the essential building blocks of an Android
- [宇宙与计算]涡旋场计算与拓扑分析
comsci
计算
怎么阐述我这个理论呢? 。。。。。。。。。
首先: 宇宙是一个非线性的拓扑结构与涡旋轨道时空的统一体。。。。
我们要在宇宙中寻找到一个适合人类居住的行星,时间非常重要,早一个刻度和晚一个刻度,这颗行星的
- 同一个Tomcat不同Web应用之间共享会话Session
cwqcwqmax9
session
实现两个WEB之间通过session 共享数据
查看tomcat 关于 HTTP Connector 中有个emptySessionPath 其解释如下:
If set to true, all paths for session cookies will be set to /. This can be useful for portlet specification impleme
- springmvc Spring3 MVC,ajax,乱码
dashuaifu
springjquerymvcAjax
springmvc Spring3 MVC @ResponseBody返回,jquery ajax调用中文乱码问题解决
Spring3.0 MVC @ResponseBody 的作用是把返回值直接写到HTTP response body里。具体实现AnnotationMethodHandlerAdapter类handleResponseBody方法,具体实
- 搭建WAMP环境
dcj3sjt126com
wamp
这里先解释一下WAMP是什么意思。W:windows,A:Apache,M:MYSQL,P:PHP。也就是说本文说明的是在windows系统下搭建以apache做服务器、MYSQL为数据库的PHP开发环境。
工欲善其事,必须先利其器。因为笔者的系统是WinXP,所以下文指的系统均为此系统。笔者所使用的Apache版本为apache_2.2.11-
- yii2 使用raw http request
dcj3sjt126com
http
Parses a raw HTTP request using yii\helpers\Json::decode()
To enable parsing for JSON requests you can configure yii\web\Request::$parsers using this class:
'request' =&g
- Quartz-1.8.6 理论部分
eksliang
quartz
转载请出自出处:http://eksliang.iteye.com/blog/2207691 一.概述
基于Quartz-1.8.6进行学习,因为Quartz2.0以后的API发生的非常大的变化,统一采用了build模式进行构建;
什么是quartz?
答:简单的说他是一个开源的java作业调度框架,为在 Java 应用程序中进行作业调度提供了简单却强大的机制。并且还能和Sp
- 什么是POJO?
gupeng_ie
javaPOJO框架Hibernate
POJO--Plain Old Java Objects(简单的java对象)
POJO是一个简单的、正规Java对象,它不包含业务逻辑处理或持久化逻辑等,也不是JavaBean、EntityBean等,不具有任何特殊角色和不继承或不实现任何其它Java框架的类或接口。
POJO对象有时也被称为Data对象,大量应用于表现现实中的对象。如果项目中使用了Hiber
- jQuery网站顶部定时折叠广告
ini
JavaScripthtmljqueryWebcss
效果体验:http://hovertree.com/texiao/jquery/4.htmHTML文件代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>网页顶部定时收起广告jQuery特效 - HoverTree<
- Spring boot内嵌的tomcat启动失败
kane_xie
spring boot
根据这篇guide创建了一个简单的spring boot应用,能运行且成功的访问。但移植到现有项目(基于hbase)中的时候,却报出以下错误:
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.Lif
- leetcode: sort list
michelle_0916
Algorithmlinked listsort
Sort a linked list in O(n log n) time using constant space complexity.
====analysis=======
mergeSort for singly-linked list
====code======= /**
* Definition for sin
- nginx的安装与配置,中途遇到问题的解决
qifeifei
nginx
我使用的是ubuntu13.04系统,在安装nginx的时候遇到如下几个问题,然后找思路解决的,nginx 的下载与安装
wget http://nginx.org/download/nginx-1.0.11.tar.gz
tar zxvf nginx-1.0.11.tar.gz
./configure
make
make install
安装的时候出现
- 用枚举来处理java自定义异常
tcrct
javaenumexception
在系统开发过程中,总少不免要自己处理一些异常信息,然后将异常信息变成友好的提示返回到客户端的这样一个过程,之前都是new一个自定义的异常,当然这个所谓的自定义异常也是继承RuntimeException的,但这样往往会造成异常信息说明不一致的情况,所以就想到了用枚举来解决的办法。
1,先创建一个接口,里面有两个方法,一个是getCode, 一个是getMessage
public
- erlang supervisor分析
wudixiaotie
erlang
当我们给supervisor指定需要创建的子进程的时候,会指定M,F,A,如果是simple_one_for_one的策略的话,启动子进程的方式是supervisor:start_child(SupName, OtherArgs),这种方式可以根据调用者的需求传不同的参数给需要启动的子进程的方法。和最初的参数合并成一个数组,A ++ OtherArgs。那么这个时候就有个问题了,既然参数不一致,那