Dashcode

Apple released a public beta of Dashcode to ADC members (including the free accounts). I have to say I am deeply impressed.
It has still some quirks, but it is stable and has stunning features.

I started this week to play around with it and I can assure you it’s fun.
Implementing a Scrollarea gave some problems for me tho.
(I admit, has a lot to do with my JS n00bness…but hey…)

If you you update the content of your scrollarea, don’t forget to refresh it…

example:

if (logstatus == 0) {
		loginhoud = logcall.outputString;
		content.innerHTML = loginhoud;
		document.getElementById("scrollArea").object.refresh();
	}
	else {
		content.innerHTML = "Problem fetching server data...";
	}

I think this is missing in the documentation…(yup, reporting it to Apple as well).

AJAX with Safari

Mental note to myself:

When making a POST request with XMLHttprequest and Safari(v2.0.4), always generate some content for the browser.

If not, the status will always be undefined.
example:

if (!$mysqli->query($insert)) {
  trigger_error("error writing data: ".$insert);
  exit;
}
else {
  echo "0";
}

This costed me some hours pulling my hair….
The following javascript works like a charm when you return a “0″ at the end of the php file called with POST. If you don’t return anything, Safari will decide that the HTTP headers are undefined and thus call the error handler.

KwAjax.ContentLoader.onReadyState=function(){
  var req=this.req;
  var ready=req.readyState;
  if (ready==KwAjax.READY_STATE_COMPLETE){
      var httpStatus=req.status;
      if (httpStatus == 200 || httpStatus == 0) {
        this.onload.call(this);
      }
      else {
        this.onerror.call(this);
      }
  }
}
 

Gargleblaster.org

This is my weblog. I started it around march 2001, shortly after I registered my 1st domain, gargleblaster.org. The name comes from the novel written by Douglas Adams: “the hitchhikers guide to the galaxy”. Besides my daytime job as coder, sysadmin, networkadmin, database-admin and projectmanager (nerf working in a small company), I try to read books, watch movies, listen to music…in other words…enjoy life.

My latest run

date: 11 Oct 08 11:36 CEST
distance: 5 km
duration: 29'12"
my last run

All my runs

total runs: 46
total km: 221.34
total time: 24:02'37"
farthest run: 7.67 km