phonegap上传图片html和服务器端端实现

phonegap上传图片html和服务器端端实现

ID:8804444

大小:42.63 KB

页数:13页

时间:2018-04-08

phonegap上传图片html和服务器端端实现_第1页
phonegap上传图片html和服务器端端实现_第2页
phonegap上传图片html和服务器端端实现_第3页
phonegap上传图片html和服务器端端实现_第4页
phonegap上传图片html和服务器端端实现_第5页
资源描述:

《phonegap上传图片html和服务器端端实现》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、PhoneGap上传图片HTML和服务器端端实现(JAVA)4人收藏此文章, 我要收藏发表于8个月前(2013-01-2410:12),已有593次阅读,共0个评论HTML代码  利用PhoneGap自己实现的API FileTransfer的upload代码001002 003004005PhoneGap_dataTransfer006

2、tf-8">007008009011

3、/javascript" charset="utf-8" src="cordova.js">012013    $(document).bind("mobileinit",function(){014 015        //$.mobile.autoInitialize=false;//删除这行配置参数就会出现渲染错误016 017        $.support.cors=true;018 019        $.mobile.allowCross

4、DomainPages=true;020 021    });022 023    varpictureSource;//picturesource024 025    vardestinationType;//setstheformatofreturnedvalue026 027    //WaitforCordovatoconnectwiththedevice028 029    //030 031    document.addEventListener("deviceready",onDeviceReady,false);032

5、 033    //Cordovaisreadytobeused!034 035    //036 037    functiononDeviceReady(){038 039        pictureSource=navigator.camera.PictureSourceType;040 041        destinationType=navigator.camera.DestinationType;042 043    }044 045    //Calledwhenaphotoissuccessfullyretriev

6、ed046 047    //048 049    functiononPhotoDataSuccess(imageData){050 051        //Uncommenttoviewthebase64encodedimagedata052 053        //console.log(imageData);054 055        //Getimagehandle056 057        //058 059        varsmallImage=document.getElementById('smallIma

7、ge');060 061        //Unhideimageelements062 063        //064 065        smallImage.style.display='block';066 067        //Showthecapturedphoto068 069        //TheinlineCSSrulesareusedtoresizetheimage070 071        //072 073        //smallImage.src="data:image/jpeg;base6

8、4,"+imageData;074 075        smallImage.src=imageData;076 077    }078 079    //Calledwhenaphotoissucces

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。