Main

February 14, 2007

Ajax Assignment #2

This week's Ajax assignments were somewhat challenging. I understood the basic concept of XMLhttprequest but had trouble with two basic issues:

1) I didn't fully understand what the PHP was doing in the examples shown in class because we did not have access to the actual PHP functions behind the scenes. I know PHP pretty well but found it hard to figure out exactly what the example PHP functions were returning to the Javascript.

2) I found it really difficult to switch between using 'regular' ajax and the Prototype API. I read the documentation but found it difficult to find example code. Then again, maybe my google searches were not good enough. I also had a significant problem using InnerHTML, which worked in the example with 'regular' ajax but not in the example where I used Prototype.

Exercise One
PHP File (in text format)

Change the loading of different sets of pictures based on pressing a different button.

Exercise Two
PHP File (in text format)

Enter in your astrological sign and get a message when you click outside the box.

Exercise Three
PHP File (in text format)

Drag a group into the box to link it to your group. (this is where the InnerHTML is not working) Running Firebug will show you the calls to PHP.

January 31, 2007

First Assignment- Ajax

These were the exercises:

Exc 1: Everybody should design a simple page HTML by hand! It doesn't need to look fancy, it's much more important that you learn how to build a page from scratch and add link to your stylesheet and your javascript code. There should be no styling information in the HTML only in the CSS. Set up a onload function that calls a javascript function that does something interesting. It change at least one thing on the page by using document.getElementById along with changing the returned node's style property.

Exc 2: Purely in javascript design a class and subclass to demonstrate that you understand the concept. The subclass should utilize the inheritance code that I showed in class. This should just be a javascript file which I can copy and paste into Firebug and run.

Exc 3: Write a short script that modifies a popular site in an interest way. This should be a javascript file that I can run on a URL that you specify.


For exercise number one check out this mock-up of the freeformed settings page. And here is the javascript. Also, you can find the css here.

For exercise two, here is the javascript file. Copy and paste it into firebug and check it out. Very simple, but I understand it (which is important).

For exercise three, what I really wanted to do was delete myspace by turning it all white. But after many hours of trying to figure it out I decided to settle on giving facebook a modernist face lift (works best if you school over the jumbled letters). Here is the javascript to put into firebug.