Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prototype AJAX fails silently in IE

Status
Not open for further replies.

jez

Programmer
Apr 24, 2001
370
0
0
VN
Hi all,

I have some code that works without error in FF but simply fails to run in IE.

I have done some alert based testing and the AJAX function does get data from the server but as soon as i try and populate any element i get nothing, no errors or any kind of hint in IE.

Here is the code
Code:
function doAjax(requestedAction, step, savestep, Obj){
		
		new Ajax.Request(targetUrl,
		  {
		    method:'post',
		    parameters:{
			action: requestedAction,
			step:step,
			savestep:savestep,
			userid:'<?=$userid?>',
			eventid:'<?=$eventid?>'
			},
		    onLoading: function (){
			$('headerMessages').update(loadImgHTML);
		    },
		    onSuccess: function(transport){
			$('headerMessages').update(normalImgHTML);
			var data = transport.responseText;
			Obj.updateFormView(data);
		    },
		    onFailure: function(){
			$('headerMessages').update(normalImgHTML);
			$('headerMessages').update('There was a problem' );
		    }
		  });
	    }
In the onSuccess branch i can alert the responseText before i use the $('headerMessages').update, but this update fails and all the code afterwards fails.

It appears that the $ notation is just not working in IE, anyone have any suggestions as i cannot really re-write the whole app.

Thanks in advance.
 
It seems that the update function is the one failing.

If i change that to innerHTML then it works.
It would be good if this
1) threw an error in IE when it fails
2) was noted in the prototype docs that it is not 100% in IE
or
3) IE just worked like a real piece of software.

On a side note, this debugging of this work is after the end of the project when all time and money is gone, so it seems that again, i am working for free on something that is caused by MS not making good software (and other devs not testing in all browsers).
Am i the only developer out there who would like to sue MS for all the 'extra' time on projects that is done for free.
 
Have you tried the long-hand notation?

Code:
Element.update($('headerMessages'), normalImgHTML);

As to your point 3, get over it and stop whinging. I'm fed up with people bitching about how crap IE is. Really... we're developers - we should be able to find solutions to these issues, not just sit and moan all day. if I moaned all day about IE, I'd be sacked. Instead, I try and find ways round problems.

Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks for the suggestion i will try it.

..And i will refrain from having any opinions in future, I didn't realise that being a developer means i am not allowed to make any observations about software that repeatedly fails to deliver.
I have been working around it since 1995, is it too much to expect it to improve?
 
Of course you're allowed to have an opinion... but when you start talking about "suing MS for all the 'extra' time on projects that is done for free." that is just ridiculous.

I accept that IE sometimes works differently from other browsers... and I accept that IE 6 didn't do things that perhaps it should have done. But talking about suing MS because of it instead of relishing the challenge of getting over these issues is going a bit too far IMHO.

As for the "done for free" bit - that's nothing to do with MS - it's your choice. Personally, I walk out of work most days at 5:30 and leave my job at work. That's not to say I don't like my job or don't do extra hours with the rest of the team when it's necessary, because I love my job, and I do.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top