Click here to Skip to main content
       

JavaScript

 
AnswerRe: Problem with IE 9 Pinmembertwseitex19-Oct-12 7:39 
Questionwindow.open not working inside frame in google chrome. PinmemberVirjin Antony10-Oct-12 1:57 
AnswerRe: window.open not working inside frame in google chrome. Pinmembertwseitex19-Oct-12 8:28 
AnswerRe: window.open not working inside frame in google chrome. Pinmembersaimimtiaz28-Oct-12 8:19 
QuestionFileUpload Inside a Gridview ItemTemplate PinmemberMember 79103609-Oct-12 19:25 
AnswerRe: FileUpload Inside a Gridview ItemTemplate PinmemberMohibur Rashid9-Oct-12 21:22 
AnswerRe: FileUpload Inside a Gridview ItemTemplate Pinmemberkavittrivedi16-Oct-12 2:29 
QuestionFile Upload in IE Pinmemberziggyfish9-Oct-12 15:26 
Hi,
 
In firefox, and chrome, I have a progress bar when someone uploads a file, however the same code doesn't work in IE (surprise surprise), it fails on:
 
var file = this.files[0];
 
My question is how do I do the equivalent for IE? Pointing me to the documentation would best.
 
code is:
function uploadImage(){
			$('#percent').progressbar({
				value: 0
			});
			$( "#dialog" ).dialog({
			resizable: false,
			height:150,
			modal: true,
			buttons: {
				Cancel: function() {
					if (xhr){
						xhr.abort();
						xhr = null;
					}
					$( this ).dialog( "close" );
				}
			}
			});
			document.getElementById('photo').addEventListener('change', function(e) {
				var file = this.files[0];
				var formdata = new FormData();
				formdata.append('file', file);
				xhr = new XMLHttpRequest();
				xhr.file = file; 
				xhr.addEventListener('progress', function(e) {
					var done = e.position || e.loaded, total = e.totalSize || e.total;
					$('#percent').progressbar('value', (Math.floor(done/total*1000)/10));
				}, false);
				if ( xhr.upload ) {
					xhr.upload.onprogress = function(e) {
						var done = e.position || e.loaded, total = e.totalSize || e.total;
						$('#percent').progressbar('value', (Math.floor(done/total*1000)/10));
 
					};
				}
				xhr.onreadystatechange = function(e) {
					if ( 4 == this.readyState ) {
						console.log(this);
						$('#src').val(this.responseText);
						$('#dialog').dialog('close');
						xhr = null;
					}
				};
				xhr.open('post', '/index/fileupload', true);
				xhr.send(formdata);
			}, false);
		}

AnswerRe: File Upload in IE Pinmembertwseitex19-Oct-12 8:31 
Questionbitwise operator question PinmemberRoger Burke9-Oct-12 13:19 
AnswerRe: bitwise operator question Pinmemberziggyfish9-Oct-12 15:31 
Question“Object doesn't support property or method 'ready'” PinmemberRohit Kesharwani9-Oct-12 1:42 
AnswerRe: “Object doesn't support property or method 'ready'” PinmemberGraham Breach9-Oct-12 20:55 
QuestionTried Typescript? What's your first impressions? PinmemberAlluvialDeposit5-Oct-12 2:01 
AnswerRe: Tried Typescript? What's your first impressions? Pinmembern.podbielski8-Oct-12 23:52 
GeneralRe: Tried Typescript? What's your first impressions? PinmemberRavi Bhavnani11-Oct-12 9:00 
AnswerRe: Tried Typescript? What's your first impressions? Pinmembern.podbielski11-Oct-12 20:25 
QuestionHow to resolve following specific bug in IE 10? PinmemberAmbesha5-Oct-12 1:15 
AnswerCrosspost PinmemberPeter_in_27805-Oct-12 2:22 
QuestionFind the selected radio button immediately using the 'this' variable in he javascript Pinmemberhiredotnet4-Oct-12 20:53 
AnswerRe: Find the selected radio button immediately using the 'this' variable in he javascript Pinmemberjohn-ph5-Oct-12 4:02 
QuestionPreventing Duplicate Form Submissions in JavaScript Pinmemberhiredotnet3-Oct-12 19:10 
QuestionUnit testing in JavaScript Pinmemberhiredotnet2-Oct-12 21:01 
AnswerRe: Unit testing in JavaScript PinmemberSpiff Dog9-Oct-12 9:43 
QuestionCreating a vertical auto-hide toolbar PinmemberChen Renjun26-Sep-12 17:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 24 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid