- Create Account

Having troubles getting this to work

Forums > HTMLHttpRequest > Having troubles getting this to work
Author
Message

1) Eli Greenberg Group: Guests
IP: 24.118.--.--
Hello,
I'm trying to use this on one of my sites and it doesn't want to work. :( I've created a link with the class="loadinto-targetArea" and I have a div with id="targetArea" but when I click the link nothing happens. I've loaded the scripts as well (obviously!) Please help!

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 118.92.--.--
Any JS errors? Try testing in a couple of browsers too. If there aren't any errors, try sticking alert() calls into a few functions to see what's being called correctly.

- Angus.

3) Eli Greenberg Group: Guests
IP: 24.118.--.--
Error: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location:  "http://minimumwage.ir8.ca/images/htmlhttprequest.js Line: 13"]
Source File: http://minimumwage.ir8.ca/images/htmlhttprequest.js
Line: 13

4) Eli Greenberg Group: Guests
IP: 65.116.--.--
It seems the problem is with this line of code:
dest.innerHTML = docText;
Any  ideas?

5) Eli Greenberg Group: Guests
IP: 24.118.--.--
I think I have figured out the problem. When I change the file extension from .xhtml to .html it works. Is there anyway to make this work with .xhtml files?

6) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Hmm! .XHTML isn't really a common extension; it might be a MIME type issue with the server or perhaps an invalid loaded document that is triggering the script's "innerHTML" content load mechanism if the DOM parsing fails.

Assuming it's a valid file, try either renaming to .HTML or perhaps putting in a .HTACCESS file that forces the MIME type of "text/html" for XHTML files.

- Angus.

7) Eli Greenberg Group: Guests
IP: 24.118.--.--
I'm not very familiar with .HTACCESS files. How would I force the MIME type of text/html for XHTML files?

8) Eli Greenberg Group: Guests
IP: 24.118.--.--
Never mind, I got it figured out. Thanks for your help Angus!

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.