回答我自己的问题...... [英] answer my own question...

查看:58
本文介绍了回答我自己的问题......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以...我的代码没有错误,我只是使用你的(在某些用途上不坏)没有成功(但你选择判断这么快,如此强大......),但是出于某些保护原因和/或特殊性,有时一些其他代码可以工作(解决方案编号3),然后我来自rails 4框架与webrick服务器(适用于Firefox 25和Chrome 29,不适用于Safari):





 function readURL(){
var input = document.getElementById(' FilePhoto');
var fReader = new FileReader();
fReader.readAsDataURL(input.files [ 0 ]);
fReader.onloadend = function( event ){
var img = document。 getElementById( blah);
img.src = event .target.result;
}
}



(无需函数事件调用...来自文件celetion字段的onchange选项正常,而且,不需要从事件调用的函数varthis



来自chakroun yesser的解决方案,这里:http://stackoverflow.com/questions/4851595/how-to-resolve -the-c-fakepath> http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepat





所以...我希望你的团队中的其他一些人能够说你慢慢去判断别人这么快,如此强烈,并试着回到学校去了解如何构建一个问题...... (等等......真是太遗憾......)。

如果你不认识男人,就说:对不起,我不知道。

解决方案

出于某些保护原因和/或特殊性,有时其他一些代码可以用来做(解决方案编号3),然后我从带有webrick服务器的rails 4框架(适用于firefox 25和chrome 29,而不是on Safari):





 function readURL(){
var input = document.getElementById(' FilePhoto');
var fReader = new FileReader();
fReader.readAsDataURL(input.files [ 0 ]);
fReader.onloadend = function( event ){
var img = document。 getElementById( blah);
img.src = event .target.result;
}
}





(不需要函数事件调用...来自文件celetion字段的onchange选项没问题,而且,从事件中调用的函数不需要varthis



来自chakroun yesser的解决方案,这里:http://stackoverflow.com/questions / 4851595 /如何对解决最C-fakepath> HTTP://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepat


so... my code has no error, i just use yours (who is not bad on some use) without success (but you choose to judge so quick, so strong...), but for some protect reason and/or specificities, sometimes some other codes can works for do it (solution number 3), and then i'm from rails 4 framework with webrick server (works on firefox 25 and chrome 29, not on Safari):


function readURL() {
  var input = document.getElementById('FilePhoto');
  var fReader = new FileReader();
  fReader.readAsDataURL(input.files[0]);
  fReader.onloadend = function(event){
  var img = document.getElementById("blah");
  img.src = event.target.result;
  }
}


(no need function event call... "onchange" option from file celetion field is ok, and also, no need var "this" on function called from event)

Solution from chakroun yesser, here: http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath">http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepat


so... i hope some other peoples from your team could said you to go slowly before judge other people so quickly and so strongly, and try to go back school for understand how is construct a question... (and so... it is really a shame...).
If you don't know guys, just said: I'm sorry, i don't know.

解决方案

for some protect reason and/or specificities, sometimes some other codes can works for do it (solution number 3), and then i'm from rails 4 framework with webrick server (works on firefox 25 and chrome 29, not on Safari):


function readURL() {
  var input = document.getElementById('FilePhoto');
  var fReader = new FileReader();
  fReader.readAsDataURL(input.files[0]);
  fReader.onloadend = function(event){
  var img = document.getElementById("blah");
  img.src = event.target.result;
  }
}



(no need function event call... "onchange" option from file celetion field is ok, and also, no need var "this" on function called from event)

Solution from chakroun yesser, here: http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath">http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepat


这篇关于回答我自己的问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆