Using TinyMCE - JS - Error: tinyMCE is not defined

Hi there. I've been trying to get a basic example of TinyMCE working, you know the WSIWYG editor for CMSs. I've posted on their official forums, but no one will help, so I decided to post on dev-archive in a last attempt to get it to work.

So far I've created my file below which is an exact copy of their wiki documentation. I've also downloaded the tinymce zip file, extracted it and placed it where it should go in relation to this file:

<?php
require_once('../includes/variables.php');
?>

<html>
<head>
<title>TinyMCE Test</title>

<script language="javascript" type="text/javascript" src="../tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
</script>

</head>

<body>
<!-- form sends content to moxiecode's demo page -->
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<textarea name="content" cols="50" rows="15">This is some content that will be editable with TinyMCE.</textarea>
<input type="submit" value="Save" />
</form>
</body>
</html>

The result is no TinyMCE buttons at all.

I've got the following errors from Firefox:

Error: tinyMCE is not defined
Source File: http://localhost/rspca/public_html/tinymce.php
Line: 8

error. I'm also getting:

Error: missing : after case label
Source File: http://localhost/rspca/tiny_mce/tiny_mce.js
Line: 1

My JS is not great so troubleshooting these probs is a bit difficult. I've checked my directories and they seem fine. Up one dir, tiny_mce tiny_mce.js. I've ran the firebug extension and all I found was the same errors that the error console brought up so wasn't much help.

It seems to have been able to find the file but not the object/class.

I've searched google for ages and all I can find is the same error, but for people using TinyMCE for Drupal or some other prebuilt cms. In fact the only properly documented instance of the same problem I found was my own post in their forums!

This is as simply as I can make the example yet it doesn't work. If anyone has a working implementation of TinyMCE please zip it and upload it for me, I'd very much appreciate it.

PS: Here is the tinymce download:
http://tinymce.moxiecode.com/download.php
[2662 byte] By [Nibinaear] at [2007-11-20 11:05:24]
# 1 Re: Using TinyMCE - JS - Error: tinyMCE is not defined
Well, if you run the examples posted, you will find that there are four. All worked for me, except for the "full featured" one.

Can you use either the simple, advanced, or word version?

This page shows all available plugins that are included in the TinyMCE distribution. Some of these plugins will only be visible on MSIE due to the lack of some support in FF. For more details on the various options on TinyMCE check the manual or for more third party plugins check the plugin section.
PeejAvery at 2007-11-8 0:43:10 >
# 2 Re: Using TinyMCE - JS - Error: tinyMCE is not defined
Hi. Here's the thing, I tried redownloading the .zip package and extracted it with winzip this time not winrar. I then ran the example_advanced.htm straight from the folder without changing a thing; I still get 2 errors in Firefox.

Did you use the .zip or tar pack? That's the only difference I can see there might be.

EDITED

The strangest thing happened. I just ran the file without it being under localhost and it worked fine. Is there some configuration I need to do in Apache to make this work?

Also discovered this:
http://www.thescripts.com/forum/thread148713.html
Nibinaear at 2007-11-8 0:44:15 >
# 3 Re: Using TinyMCE - JS - Error: tinyMCE is not defined
The strangest thing happened. I just ran the file without it being under localhost and it worked fine. Is there some configuration I need to do in Apache to make this work?
That means it is a security issue. Under your Internet Options, add localhost (127.0.0.1) to your trusted sites.
PeejAvery at 2007-11-8 0:45:11 >