Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Jesse Prabawa
Hi Eric, Have you considered using a Javascript Library to handle these details? I would recommend that you refactor your code to use one so that you can concentrate on what you actually want to do instead. This way you can also avoid having browser incompatabilities that are already solved if

Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Godmar Back
You're using IE, which means you need to issue the open() before adding the onreadystatechange handler. Otherwise, open will trigger a call to your handler, and IE's implementation won't have reset the readyState to 0. In either event, you should double-check that the status of the request is 200

[CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Eric Lease Morgan
Why doesn't my httpRequest Javascript function return unless I add an alert? Grrr. I am writing my first AJAX-y function called add_tag. This is how it is suppose to work: 1. define a username 2. create an httpRequest object 3. define what it is suppose to happen when it gets a response

Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Ewout Van Troostenberghe
To point out why the use of a Javascript framework is important, let me put your code into jQuery (http://jquery.com) $.get('index.cgi', {cmd:'add_tag', username:'username'}, function(html) { // do whatever you want here }) PrototypeJS has a similar, easy to use construct. In the end, using

Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Andrew Nagy
9:22 AM To: CODE4LIB@listserv.nd.edu Subject: [CODE4LIB] httpRequest javascript grrr Why doesn't my httpRequest Javascript function return unless I add an alert? Grrr. I am writing my first AJAX-y function called add_tag. This is how it is suppose to work: 1. define a username

Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Keith Jenkins
jQuery++ I like to do things from scratch, but have never regretted moving to jQuery. Whatever time it takes you to check it out will be paid back a thousand times, at least. Keith On 11/29/07, Ewout Van Troostenberghe [EMAIL PROTECTED] wrote: To point out why the use of a Javascript

Re: [CODE4LIB] httpRequest javascript.... grrr

2007-11-29 Thread Andrew Nagy
Subject: Re: [CODE4LIB] httpRequest javascript grrr These days I think jquery seems more generally popular than prototype. But both are options. I definitely would use one or the other, instead of doing it myself from scratch. They take care of a lot of weird cross-browser-compatibility stuff

Re: [CODE4LIB] httpRequest javascript.... grrr [resolved]

2007-11-29 Thread Eric Lease Morgan
On Nov 29, 2007, at 9:21 AM, Eric Lease Morgan wrote: Why doesn't my httpRequest Javascript function return unless I add an alert? Grrr. I have resolved my problem, but I'm not exactly sure how. First of all, my httpRequest (XMLHttpRequest) code was just fine. I made no significant changes