Click here to Skip to main content
15,884,986 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Problem with IE 9 Pin
twseitex19-Oct-12 7:39
twseitex19-Oct-12 7:39 
Questionwindow.open not working inside frame in google chrome. Pin
Virjin Antony10-Oct-12 1:57
Virjin Antony10-Oct-12 1:57 
AnswerRe: window.open not working inside frame in google chrome. Pin
twseitex19-Oct-12 8:28
twseitex19-Oct-12 8:28 
AnswerRe: window.open not working inside frame in google chrome. Pin
saimimtiaz28-Oct-12 8:19
saimimtiaz28-Oct-12 8:19 
QuestionFileUpload Inside a Gridview ItemTemplate Pin
Member 79103609-Oct-12 19:25
Member 79103609-Oct-12 19:25 
AnswerRe: FileUpload Inside a Gridview ItemTemplate Pin
Mohibur Rashid9-Oct-12 21:22
professionalMohibur Rashid9-Oct-12 21:22 
AnswerRe: FileUpload Inside a Gridview ItemTemplate Pin
kavittrivedi16-Oct-12 2:29
kavittrivedi16-Oct-12 2:29 
QuestionFile Upload in IE Pin
ziggyfish9-Oct-12 15:26
ziggyfish9-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:

JavaScript
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:
JavaScript
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 Pin
twseitex19-Oct-12 8:31
twseitex19-Oct-12 8:31 
Questionbitwise operator question Pin
SuperRoo29-Oct-12 13:19
SuperRoo29-Oct-12 13:19 
AnswerRe: bitwise operator question Pin
ziggyfish9-Oct-12 15:31
ziggyfish9-Oct-12 15:31 
Question“Object doesn't support property or method 'ready'” Pin
Rohit Kesharwani9-Oct-12 1:42
Rohit Kesharwani9-Oct-12 1:42 
AnswerRe: “Object doesn't support property or method 'ready'” Pin
Graham Breach9-Oct-12 20:55
Graham Breach9-Oct-12 20:55 
QuestionTried Typescript? What's your first impressions? Pin
StianSandberg5-Oct-12 2:01
StianSandberg5-Oct-12 2:01 
AnswerRe: Tried Typescript? What's your first impressions? Pin
n.podbielski8-Oct-12 23:52
n.podbielski8-Oct-12 23:52 
GeneralRe: Tried Typescript? What's your first impressions? Pin
Ravi Bhavnani11-Oct-12 9:00
professionalRavi Bhavnani11-Oct-12 9:00 
AnswerRe: Tried Typescript? What's your first impressions? Pin
n.podbielski11-Oct-12 20:25
n.podbielski11-Oct-12 20:25 
QuestionHow to resolve following specific bug in IE 10? Pin
Ambesha5-Oct-12 1:15
Ambesha5-Oct-12 1:15 
AnswerCrosspost PinPopular
Peter_in_27805-Oct-12 2:22
professionalPeter_in_27805-Oct-12 2:22 
QuestionFind the selected radio button immediately using the 'this' variable in he javascript Pin
hiredotnet4-Oct-12 20:53
hiredotnet4-Oct-12 20:53 
AnswerRe: Find the selected radio button immediately using the 'this' variable in he javascript Pin
John-ph5-Oct-12 4:02
John-ph5-Oct-12 4:02 
QuestionPreventing Duplicate Form Submissions in JavaScript Pin
hiredotnet3-Oct-12 19:10
hiredotnet3-Oct-12 19:10 
QuestionUnit testing in JavaScript Pin
hiredotnet2-Oct-12 21:01
hiredotnet2-Oct-12 21:01 
AnswerRe: Unit testing in JavaScript Pin
Spiff Dog9-Oct-12 9:43
Spiff Dog9-Oct-12 9:43 
QuestionCreating a vertical auto-hide toolbar Pin
Chen Renjun26-Sep-12 17:02
Chen Renjun26-Sep-12 17:02 

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

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