Announcment Lists and AJAX

software development

#1

Hi,

I am using the Announcement Lists feature. However, instead of specifying a different page for each type of response (Sent confirmation e-mail, unsubscribed, etc.), I want to use Ajax to get the response code sent back to the same page where people sign up. Is this possible?

One idea I had was to put, as the URL for all the response pages, and cgi script that parses the user’s e-mail address and response code from the query string and just prints it back as the response. But maybe there is a better way.

Also, I understand that, for security reasons, Firefox doesn’t allow AJAX requests to go to a different domain or something. This seems to be a problem because the script to run the Annoucment CGI is on http://scripts.dreamhost.com/add_list.cgi, which is obviously different than my domain.

Any ideas?

Thanks,

Isaac


#2

I would also like to use Ajax with my subscription form. With DH coming down hard with their Anti-Spam policy, I’d like to see more support for the only alternative they give.

There’s nothing on the web or in the wiki about customizing anything with the add_list.cgi. Even /that/ points to Dreamhost and not your own domain.

DH, could we at least get some Ajax support, please? Help me keep my site all top-notch and trendy-user-friendly?


#3

So, after emailing the tech support team, this was what I got:

Well the form code itself is very very basic. It was based off of a
popular formmail script that was freely available. It is something
similar to this:

http://www.scriptarchive.com/formmail.html

I’m not sure what parts would be beneficial to kind of ajax out, unless
the form just submits and immediately lets you know you’re in the list or
something like that. What I’ve experienced is that you can always find
something that you can ajax to make it smoother. So I’d say it’s
possible. Check out that formmail script above and see if you can figure
something out though.

Now, I tinkered around trying to get an asynchronous request going through Prototype, but so far, it seems non-responsive. The script does, indeed, use custom addresses for the different responses, so I’m wondering if these responses can be interpreted by prototype (maybe with a little help?) and fed back to update a div.

Unfortunately, this is as far as my skill takes me. I’m no programmer, so if someone else could take this on, by all means, please keep us updated here. We may even figure something out and add it to the wiki?


#4

I realize this post has been dead for about a month, but I thought you guys had a great idea. I took the time and implemented this for us all! Unfortunately, I don’t have any special requirements and am a bit strapped for time, so my testing was rather short.

If you want to read my blog post (complete with download link) go to http://quad341.com/2007/06/21/dreamhost-list-ajax/ (the download link is at the bottom). Feel free to comment either there or on this forum. I’ll do my best to respond.

If you want to see it in action first, I have it set up on http://www.chilloutmixes.com/ . Since you have to verify your email anyway, feel free to try it there without worrying about subscribing to the list (though feel free if you want. it is live)


#5

Nicely done! Thanks for taking the time to do that and for sharing it with us. Rock On! :slight_smile:

–rlparker