[Exception… "Could not convert JavaScript" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"

What the heck is.. uncaught exception: [Exception… “Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)” location: “JS frame :: PATH_TO_MY_JAVASCRIPT_FILE :: THE_METHOD_NAME :: line #” data: no] For me it was just an appendChild() that was causing the problems. You can always try the innerHTML+= way if Read more…

By Andrew Odendaal, ago

Error 406?

So you received an error 406 while trying to upload a file and you have no idea to fix it! Create a “.htaccess” file in the root of your local website and add the following into it: <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>

By Andrew Odendaal, ago

shortText function toggler in php

I often have to show a shortened version of a news item and then a link to show the entire news article or whatever. Here’s a way to get that short text! [code lang=”php”] function shortText($text, $length) { if( strlen($text) > $length ) return substr(preg_replace(“/(]*>)/”, “”, $text), 0, $length).”…”; return Read more…

By Andrew Odendaal, ago