PHP Learnings

I recently have been working on a new API Browser for jQuery. It’s been a pet project in the back of my mind for some time. I thought I could create a better mousetrap, if only I could get over the programming hump. So finally, last week, I took a few tentative steps forward.

First, I got a good section of it working with pure jQuery. The problem with this approach was that it was very slow. Loading in a giant XML file into the browser and then parsing it took alot of time. So I decided to figure out some PHP do do the heavy lifting. It took me a little while to figure out what was the deal with the -> symbols everywhere. What was a variable? What was an object?

Surprisingly, it went much quicker than I thought it would. I got the basics going in a day, and then refined it this morning at 5am. Getting a variable out of the URL was super-duper simple. I literally didn’t have to do anything. Here is the source of the main page and here is the super XmlReader.php that I created. It’s designed specifically for the jQuery API. It’s not very long and pretty readable. I have the part working where it builds the autocomplete array. I have the part where it builds the list on the left hand side. The next thing I need to do is build the links on the list which calls the same XmlReader and returns a html snippet for the example. I was thinking of putting that html in a modal window or a tab.

I have not gotten stuck so far. (fingers crossed)

2 Replies to “PHP Learnings”

  1. I love the idea of your API, and your initial steps look great. jQuery is my favorite JavaScript library, I’ll definitely make great use of the API when it’s done. Thanks for the work you’re putting in to it!

    Aside: my great uncle used to coach the Jets back in the early 80’s, Walt Michaels.

  2. Sarissa is a “cross-browser wrapper for native XML APIs” that works very well inside Javascript. I’ve used it in the past and it’s pretty fast.

    That being said, I think Flex is the wave of the future. I’ve started my own Flex based JQuery viewer, just the project I’ve been looking for to get more involved in Flex development. Just have the basics down for now, but I will refine over the next couple of weeks; http://www.hackersgolf.net/test/jqueryviewer.html

Leave a Reply