Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inline AJAX spellchecker

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

I've *finally* (after hours of searching) found a decent looking Spellchecker, which utalizes google's spell checking tools.

However, I can't get it to work :/


The script is from:


All I've done, is upload version 3.97 (tried version 4, but get same issues)

Basically, when I press the "spellcheck" button, it comes up with an alert box, saying:

>>An error was encounted with the server. Please try again later.<<

I've done a search on google, to see if anyone else has had this issue - and it looks like some people have. However, their fixes just seemed to be updating to the latest .js files - which I've tried :/

In IE 8, I get this error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30618; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Tue, 8 Sep 2009 17:37:53 UTC


Message: Access is denied.

Line: 606
Char: 9
Code: 0
URI:

I don't get any JS errors in FF 3.

Anyone got any pointers, or better yet - another AJAX script that works? Ideally, I need one that will work with a WYSIWYG editor, as well as a plain text one)

TIA

Andy
 
Without doing any research or looking into the problem or your code at all, my gut hunch from the 'access denied' error message is that you have a cross-domain issue.

Perhaps you're including the script from their site, but using it on your own instead of copying their files locally?

Are there any cross-domain issues in play, or is my gut hunch wrong?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi,

Thanks for the reply :)

Mmm, all the script looks like its calling from my end:

<script type="text/javascript" src="googiespell/AJS.js"></script>
<script type="text/javascript" src="googiespell/googiespell.js"></script>
<script type="text/javascript" src="googiespell/cookiesupport.js"></script>
<link href="googiespell/googiespell.css" rel="stylesheet" type="text/css" media="all" />


Cheers

Andy
 
As this works in FF and not in IE it will be a little harder to debug, assuming that the error line shown is correct, the issue seems to be around :

Code:
        req.open(type, url, true);

suggest you put some alerts in the code to see what is going on in that function.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi,

It doesn't work in IE or FF =) (just in FF, I get no error message, and get that popup alert)

Cheers

Andy
 
Actually, Firefox does throw an error (click Tools -> Error Console to see it):

Error said:

I guess my hunch was right!



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Ah ok thanks - it didn't give me one - weird.

Will check into it

Cheers

Andy
 
Hi,

Ok, kinda getting somewhere =)

I now have this system setup (this is just the demo, from the file I downloaded);


From here, it opens a popup - which then lets you go through ALL the mis-spelled words.

Now, the problem I seem to be having - is invoking it :( (cos again, its not a bloomin textarea - but a IFRAME)

I'm calling it with:

'<span id="link" title="Link Div" onclick="<%--openSpellChecker(this);--%>alert(document.getElementsByTagName(\'editor_iframe\'))" class="tb_menu_item">\n' +
' <img id="linkImage" title="Link" class="tb_icon" src="/test2/images/spellcheck.png" alt="Spell Check"></img>\n' +
'</span>\n' +

..and then this in the header :

<script src="/spellchecker/spellChecker.js"></script>

<script>
//
// openSpellChecker()
//
// this function is an example that illustrates the various ways you can invoke
// the the Speller Pages spell-checking process
//

function openSpellChecker(thisform) {

// example 1.
// Pass in the text inputs or textarea inputs that you
// want to spell-check to the object's constructor,
// then call the openChecker() method.
var textarea1 = thisform;
var speller = new spellChecker( text1, textarea1 );
speller.openChecker();

// example 2.
// Rather than passing in the form elements to the object's
// constructor, populate the object's textInputs property,
// then call the openChecker() method.
/*
var speller = new spellChecker();
var spellerInputs = new Array();
for( var i = 0 ; i < document.form1.elements.length; i++ ) {
if( document.form1.elements.type.match( /^text/ )) {
spellerInputs[spellerInputs.length] = document.form1.elements;
}
}
speller.textInputs = spellerInputs;
speller.openChecker();
*/

// example 3.
// use the spellCheckAll() method to check every text input
// and textarea input in every form in the HTML document.
// You can also use the checkTextBoxes() method or checkTextAreas()
// method instead of spellCheckAll() to check only text inputs
// or textarea inputs, respectively
/*
var speller = new spellChecker();
speller.spellCheckAll();
*/
}

</script>


The problem is, I get an error about "form1" not being defined - which makes sense, as its not a form :p

What I've been trying to do - is grab the WHOLE contents of the "iframe", and then passing that :/

You can see it running here: (andytest/andytest) .. click the little button that has an "abc" on it - thats the one I'm trying to get working)

If anyone can suggest stuff, I'm all ears. I'm at my wits end with this blooming spellchecking stuff :|

TIA

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top