Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-01-16 14:41:33

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

"'Xinha' is undefined" error ....

I've installed Xinah as well as the latest hotfix from January 14th.  I'm trying to implement this in a .NET 2.0 web application.

I'm not sure what the problem is, as I can open up and see the 'ext_example.html' example file just fine.

I get an "Xinha is undefined" error at this point:

     // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
     if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

My code looks like this:

    <script type="text/javascript">
        _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "en";      // And the language we need to use in the editor.
    </script>
   
    <script type="text/javascript" src="~/Administration/xinha/XinhaCore.js"></script>

    <script type="text/javascript">
        xinha_editors = null;
        xinha_init    = null;
        xinha_config  = null;
        xinha_plugins = null;

        // This contains the names of textareas we will make into Xinha editors
        xinha_init = xinha_init ? xinha_init : function()
        {
            /** STEP 1 ***************************************************************

            ............................

         }
    </script>



Any ideas?

Thanks,
Suzanne

Offline

#2 2007-01-16 15:44:52

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

Seems XinhaCore.js is not loaded.
Is suppose this path is wrong   

suzannesmith wrote:

<script type="text/javascript" src="~/Administration/xinha/XinhaCore.js"></script>

as it doesn't correspond with this

suzannesmith wrote:

_editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed

Offline

#3 2007-01-16 15:54:35

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

Good call.  I changed the following:

_editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed

to

_editor_url  = "~/Administration/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed

But still no dice.  Any other suggestions?

Thank you for your help,
Suzanne

Offline

#4 2007-01-16 16:02:58

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

Enter ~/Administration/xinha/XinhaCore.js in your location bar. Is the file found?

Otherwise if you have this page online, I could look at it. usually its just a simple error...

Offline

#5 2007-01-16 16:09:04

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

It's also advisable to use the form /path/from/webroot/to/file/ (with leading slash)

Offline

#6 2007-01-16 16:26:43

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

Yep - XinhaCore.js is found.

My application that's using Xinha is in a folder called "Administration" (which is directly under the root folder).  The "xinha" folder is also under the "Administration" folder, inline with my application.

So then, shouldn't this work?

    <script type="text/javascript">
        _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "en";      // And the language we need to use in the editor.
    </script>
   
    <script type="text/javascript" src="/xinha/XinhaCore.js"></script>


Thank you,
Suzanne

Offline

#7 2007-01-16 16:33:09

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

Let's say you have:
www.domain.com/administration/page.html
www.domain.com/administration/xinha/XinhaCore.js etc.

Then it would be

    <script type="text/javascript">
        _editor_url  = "/administration/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "en";      // And the language we need to use in the editor.
    </script>
   
    <script type="text/javascript" src="/administration/xinha/XinhaCore.js"></script>

Offline

#8 2007-01-16 16:41:11

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

Shoot ... I'm still getting the "Xinha is undefined" error.

I changed my code to this:

    <script type="text/javascript">
        _editor_url  = "/Administration/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "en";      // And the language we need to use in the editor.
    </script>
    
    <script type="text/javascript" src="/Administration/xinha/XinhaCore.js"></script>

Thank you again,
Suzanne

Offline

#9 2007-01-16 16:43:47

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

Ok I think there is nothing more at this point I can say without seeing the actual installation, sorry sad

Offline

#10 2007-01-16 16:47:05

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: "'Xinha' is undefined" error ....

Are you using Firefox? There are some nice extensions (e.g. FireBug) that help analysing problems like this. I'm still of the opinion that there is a problem with the paths

Offline

#11 2007-01-16 17:00:51

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

I've got access to FirefoxPortable (I'm not allowed to download Firefox onto my computer - so I just run the FirefoxPortable.exe from my jump drive).

I'm not doubting that there might be a problem with my paths; I just don't know what the problem is ....

Thank you,
Suzanne

Offline

#12 2007-01-16 17:34:28

jedi58
Xinha Authority
From: Leicester, UK
Registered: 2007-01-14
Posts: 113
Website

Re: "'Xinha' is undefined" error ....

The tilde on Unix based servers is used to represent the home directory of the currently logged in user - in the case of the browser this would be something like www, www-data, or maybe even wwwrun. In the case of javascript links it's usually used before the username since it can't navigate the directory structure, only what is publically available. Is it accessed as http://<your-webserver-url>.com/Administration/xinha/ or are there any other folders in between the domain and the Administration folder?


David G. Paul
[url]http://www.newearthonline.co.uk[/url]

Offline

#13 2007-01-17 10:00:50

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

Yes - access to our website is via http://<your-webserver-url>.com/Administration/xinha/.  The Administration folder is a top-level folder.

Any ideas?

Thanks!
Suzanne

Offline

#14 2007-01-17 11:38:00

jedi58
Xinha Authority
From: Leicester, UK
Registered: 2007-01-14
Posts: 113
Website

Re: "'Xinha' is undefined" error ....

okay, here's a long shot, is XinhaCore.js accessible to the web?

Could you goto http://<you-webserver-url>.com/Administration/xinha/XinhaCore.js ? Hopefully you should be able to actually view the file, if not and it instead gives Permission denied or such like, then try and get the permissions changed for that file so it is executable by the web.

Also, have you tried it without the leading slash?


David G. Paul
[url]http://www.newearthonline.co.uk[/url]

Offline

#15 2007-01-17 12:18:59

suzannesmith
New member
Registered: 2007-01-16
Posts: 9

Re: "'Xinha' is undefined" error ....

Okay - I found the problem.  I had to include the root folder in the path:

    <script type="text/javascript">
        _editor_url  = "/NIGHTSDEV2/Administration/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "en";      // And the language we need to use in the editor.
    </script>
  
    <script type="text/javascript" src="/NIGHTSDEV2/Administration/xinha/XinhaCore.js"></script>

But now, I've encountered another problem.  Xinha isn't working correctly with AJAX.  Should I start a new thread or just continue with this thread?

Thanks again,
Suzanne

Offline

Board footer

Powered by FluxBB