YUI and AJAX scripts not working in IE

October 7, 2009 at 22:53:27
Specs: Windows Vista, 1.2Ghz/2GB
Hi All,

I have almost given up on this, though I don't really want to, I don't have any options, so I really need to resolve this.

I just started learning YUI on my own and I am using it in the front page layout I am working on. I have this done and working, but for some strange reason it is not working in IE. It works in Firefox and it works in Google Chrome. Worse still, there is no way of debugging in IE, so I cannot even nail down what the problem is.

The flow is, when you click the "Enter" Button, it pops up a div which provides a user with option to enter their email. On clicking submit, the YUI scripts should perform a POST and get a return answer. All this works in other browsers, but something is causing to fail in IE. If anyone can help me out and have a look, I will very much appreciate it. I have been on this for 3 days and I can't take it anymore.

To make things easy, I have zipped the components in here http://www.anifstudios.com/XX_RM_We...

See More: YUI and AJAX scripts not working in IE

Report •

October 8, 2009 at 17:40:44
You've got a trailing comma on the end of your options list:

misc.js line 71:
headers: { 'X-Transaction': 'POST Example'},

Change to:
headers: { 'X-Transaction': 'POST Example'}

IE is picky about such things.

Report •

October 8, 2009 at 21:28:42
OMG..wow, thanks a lot!!! How in the world did you debug that!! I was almost about to take this down, 'cos I ended up finding a JQuery solution which uses like 75% less code. I really like the functionality of YUI from which I read in the docs, but it honestly just seems really bloated at times. JQuery was so much easier to attach a plugin and call. Now I'm stuck, I have 2 solutions to decide from.

From your experience, what do you think, if you have used JQuery also. Thanks a lot though for helping out.

Report •

October 8, 2009 at 21:42:03
I will say this though, the YUI seems way more robust, so maybe I'll just try to be more careful and watch my syntax.

Report •

Related Solutions

October 11, 2009 at 12:48:35
Hey, sorry about the delay in my reply.

About debugging that - the script error icon in IE (bottom left) is completely useless - except for the LINE number, it (usually) gets that right.

For instance, that script was was throwing the error on index.html:71 - so I just checked your JS files on line 71 & found that in misc.js.

jQuery is my favorite JS framework hands down, I've used mootools, scriptaculous and prototype, but JQ's minimal syntax & the huge amount of plugins available makes it my fav.

I've never used YUI though - I've looked at it, and as you say, it seems bloated & requires lots of differnet files for what seems like basic functionality.

Does YUI offer something more than jQuery does for you??

Report •

October 11, 2009 at 19:55:31
Well, YUI just seems to have more control in an odd to explain kinda way. I'm no expert, so maybe it's just me screwing up. Honestly, after you debugged my error, I ended up going back to the YUI solution. I was trying to modify something with the JQuery HTTP POST script solution which I couldn't get to work. The YUI IO module version which has the HTTP POST method, gave me the flexibility to add my own custom code/functions to the already existing functionality. It is bloated to use and adding all that crap, but the advantage it seems to me is the way you can layer custom stuff. But maybe it's just me. Anyway, it seems the best solution is hybrid. A mix of both YUI and JQuery, wherever they work better. For example, I was using JQuery for the facebox.

Report •

Ask Question