Archive for September, 2007

geek stuff: IE6 “Page cannot be displayed” fix in PHP

Thursday, September 20th, 2007

If you’re working with forms in PHP, and especially if you’re working with forms that have multiple steps, you’ve probably run across the “back button” problem in IE6. Here’s what it looks like:
1) you fill out a form and click the “submit” button – this takes you to another page.
2) you click the “back” [...]

discovered

Monday, September 10th, 2007

Blessings on the forgotten, and the wonderful, and the strange.

geek stuff: passing parameters to onreadystatechange in AJAX

Thursday, September 6th, 2007

Maybe everyone knows this, but I’ve seen very little about it online. The vast majority of AJAX-oriented functions looks something like this:

var xmlHttp
function showHint(str)
{
if (str.length==0)
  { 
  document.getElementById(“txtHint”).innerHTML=”"
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert (“Browser does not support HTTP Request”)
  return
  } 
var url=”gethint.php”
url=url+”?q=”+str
url=url+”&sid=”+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open(“GET”,url,true)
xmlHttp.send(null)

This function (taken from a w3schools tutorial) calls a function named stateChanged() when it receives data. stateChanged handles the display of response data, and looks like this:

function stateChanged() 

if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)
 { 
 document.getElementById(“txtHint”).innerHTML=xmlHttp.responseText 
 } 
}

Note that this function accepts no [...]

@ somniloquy.org