Debugging, BASE, Opera and XHR

I’ve been going crazy trying to make my new ajaxy review creation tool cross-browser. It isn’t working out at all. IE gets stuck and gives terrible, totally non-helpfull debug information. A line number, but it won’t even specify the script it happened in, or what kind of error it was. Terrible, and I can’t find anything on debugging in IE, a plug-in like firebug would be nice.

I also found out, that as of Opera 9.10, it does not apply the BASE tag to script requests. I don’t know if that’s spec or not, but I had to apply absolute paths to a bunch of XHR’s to get them working in Opera. That one took a while to find, but I found the debugging stuff for Opera, and it’s not terrible.

I haven’t even thought about Safari, I’m kind of scared of it actually. Right now I’m going with a second set of scripts that don’t use all the fancy stuff in them, and I’m using %{HTTP_USER_AGENT} and mod_rewrite to push browsers to the right place.

Good times.

Posted March 26th, 2007 - Permalink
Categories: JavaScript - OurUNO - PHP - Programming - Projects
No Comments »
 
Fun with mootools

I was playing with mootools today, and whilst trying to create a swapping pair of content divs, I put together a neat algorithm for handling the callbacks and getting it to do what I want.

I only wanted one div showing at a time, and I wanted them to swap with a function. So I set up the following guardian variable and functions. Check it out.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var loadingDiv;
var contentDiv;
var transitionState = 0;
 
window.onload = function () {
  loadingDiv = new Fx.Slide('loadingDiv', {onComplete: nextTransition});
  loadingDiv.hide();
  contentDiv = new Fx.Slide('contentDiv', {onComplete: nextTransition});
}
 
function swapThem() {
  if(transitionState == 0) {
    transitionState = 1;
    contentDiv.slideOut();
  }
  else {
    transitionState = 2;
    loadingDiv.slideOut();
  }
}
 
function nextTransition() {
  if(transitionState == 1) {
    transitionState = 3;
    loadingDiv.slideIn();
  }
  else if (transitionState == 2) {
    transitionState = 4;
    contentDiv.slideIn();
  }
  else if (transitionState == 4) {
    transitionState = 0;
  }
}

It might be a little verbose, but it works like a charm.

Posted March 18th, 2007 - Permalink
Categories: JavaScript - Programming
No Comments »
 
BlowPass V0.60 - A Major Revision

Just finished up BlowPass 0.60. This was a major overhaul of the system, and there are very few similarities between the 0.50 and 0.60. Here’s a quick roundup of every change (Or at least those I could remember.)

New Domain
That’s right, BlowPass now has it’s own domain, BlowPass.com Now you can get there quick, none of this sub-domain garbage anymore. This isn’t really a code change, but it’s still a nice feature.

Installer!
Just kidding that’s not done yet.

New Logo
BlowPass Logo
Sexy new reflected logo. It can only be beat by…

New Layout
After months of market research we have a new layout.
It’s clean, it fits in an 800×600 screen and it’s very blue. Plus…

The Log Is Optional
If you don’t want to see the technobabble, don’t open it.

Partial JSON
Smaller responses mean faster loads. Hopefully I’ll get around to moving it all into JSON and then we’ll be even faster.

Compressed Libraries
Everything has been squashed by the DoJo thingy. (Or will be soon.)

Prototype 1.5
Because hipness matters.

Sorting
You can now sort your items by last modified date, name, or…

Item Type
There are now several item types, “Network Account”, “System Account” are active by default, and if you think there should be another, let me know!

Okay, wasn’t that exciting? Here’s something even more exciting, the planned changes for V0.70.

Cleaner Code
There are a lot of repetitive chunks that need making into function calls.

JSON
More JSON for transmission, less delimited strings. Also, switch JSON to native when we get to PHP 5.2

SSL
This kind of service really needs SSL, but I don’t have the $189 to get that done at this point. If you really want to be secure, do what I do, run it on your home machine with your own SSL cert.

Delete Functionality
Finally add the ‘delete’ button for items now that we’re using PHP sessions.

Create New Types
User created item types should be done soon too.

We’ll see how it goes from here, could be a few months before the next release.

Posted January 30th, 2007 - Permalink
Categories: BlowPass - JavaScript - PHP - Programming - Projects
No Comments »
 
New prototype.js Website

My favorite js library has got itself a new home at prototypejs.org. The new site is much better than the old stuff and the API is very handy. Check it out if you want a super handy lib.

Posted January 21st, 2007 - Permalink
Categories: JavaScript - Programming
No Comments »
 
Das BlinkenTechts!

I was kicking around the WebDeveloper forums this morning and found a little project to keep me busy. A user was looking for a simple way to blink the colors of some text. I wrote up a flexible little class in JavaScript to handle it.

Really simple to implement, and kind of a minimalist class. Just include the file, add name attributes to the ones you want to blink and set up the window.onload. Here’s an example of the onload:

window.onload = function () {
  var bT = new blinkenTechts(new Array("#000","#F00","#00F"), 'targetName', 500);
}

With that configuration every element with the name targetName would rotate through the colors black, red, and blue on a half-second interval once bT.blink(1) was called.

For more example peek at the source of these little example blinkenTechts. You can download the source here.

Ze blinkin techts!

Das ist mas blinkin techts!

Ze blinkin techts!

Das ist mas blinkin techts!


Posted January 9th, 2007 - Permalink
Categories: Internet - JavaScript - Programming
No Comments »
 
More Posts
« Older
Newer »