[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

Stop mouse click in browsers

There have been multiple ways to stop your user/s from right clicking on your site, but many of them now fail due to the way firefox’s contextual menu loads. Below is an example of how to do it: [code lang=”javascript”] function _c(e) {if (document.all) {if (event.button==2||event.button==3) {return false;}} else {if Read more…

By Andrew Odendaal, ago

Sending data from javascript to php

If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try encodeURIComponent() to wrap your strings in. The function escape() can also be used, but I would not recommend it as encodeURIComponent() is better, it also escapes Read more…

By Andrew Odendaal, ago

Add TinyMCE code button

I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.x). All is resolved now and this is what I had to change: Both changes are made in “editor_template.js” file, I also swopped the 2 files so that I Read more…

By Andrew Odendaal, ago