/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] problem with arrays..

Im trying to make a program for analyzing language. Im using a model that is well known for analyzing my language.

The problem works so I have a sentence that the surfer needs to put into boxes(sorted in verbal, subject, etc.).

I made the program so you highligt a box, byt clicking it- and afther that click each word in the sentence to put it in one of the boxes.

Howerver I need the words to keep their respective places in the boxes.

For instance- if the sentence is “Help me please” and if I choose to put all 3 in box#3- BUT I want to click “please” 1st- then “Help” and last “me”- they should all end as “Help me please” in the box. This should work with large sentences as well of course.

Another example if there is 10 words- I(the user) want to put 3 in box 1, 4 words in box 2 and 3 in box 3- no matter what order they are clicked- they should keep the same order as in the sentence before it was sorted.

Ive tried 2-dimensionel arrays- but I just can get it working:-(

This is the program(small scale- when im done its gona be about 8 boxes and it has to work with all size sentences, I know its a bit of a mess- but please focus on my problem:-P):

<HTML>
<HEAD>
<TITLE>Online løsning af sætningsskema</TITLE>

<style type=”text/css” media=”screen”>

.hlt {
background-color: #999;
color: black;
}

</style>

<script type=”text/javascript”>

////////
function delete_cookie ( cookie_name )
{
var cookie_date = new Date ( ); // current date & time
cookie_date.setTime ( cookie_date.getTime() – 1 );
document.cookie = cookie_name += “=; expires=” + cookie_date.toGMTString();
}
delete_cookie ( “basket” );
delete_cookie ( “empty” );

document.cookie = basket=”empty”;

//////
function Set_Cookie( name, value )
{
document.cookie = name + “=” +escape( value );
}

////////
// this function gets the cookie, if it exists
function Get_Cookie( name ) {
var start = document.cookie.indexOf( name + “=” );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( “;”, len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}

////////
var total=3;

var facit=new Array()
facit[1]=’Help’
facit[2]=’me’
facit[3]=’please’

var abe=new Array();
abe[1]= ”;
abe[2]= ”;
abe[3]= ”;

var ko=new Array();

////////
function getCellIndex(cell) {

var rtrn = cell.cellIndex || 0;
if (rtrn == 0) {

do{
if (cell.nodeType == 1) rtrn++;
cell = cell.previousSibling;
} while (cell);
rtrn–;
}
return rtrn;
}

////////

function mouse_event (e){
var e = e || window.event;
var obj = e.srcElement || e.target;

var tn = (obj.nodeType == 1)?obj.tagName.toLowerCase():’x’;

while(tn !=”td” && tn != “tbody”){
obj= obj.parentNode || obj.parentElement;
tn = obj.tagName.toLowerCase();
}
if (tn == “td”) {
var idx = getCellIndex(obj);
var id = “c” + ++idx;

document.getElementById(“c1”).className = “”;
document.getElementById(“c2”).className = “”;
document.getElementById(“c3”).className = “”;
document.getElementById(id).className = “hlt”;
Set_Cookie(basket, id);

// document.cookie = basket=id;

}
}

window.onload = function () {
document.getElementById(“binding”).onclick = mouse_event;

};

////////

function pross(numb)
{
var x = Get_Cookie(basket);
if (x==null) {alert(“Først skal du markere en kolonne”)}
else {
var y=x.charAt(1);

if (numb < ko[y])
{
abe[y]=facit[numb] + ” ” + abe[y];
}
else
{
abe[y]=abe[y] + ” ” + facit[numb];
}
ko[y]=numb;

document.all[x].innerHTML = abe[y];
var id = “satn” + numb;

document.all[id].innerHTML = facit[numb];

}
}

</script>

</head>
<Body>

<TABLE BORDER=0>
<TR>
<SCRIPT>

for (q=1;q<=total;q++)
{
document.write(“<TH><DIV ID=’satn” + q + “‘>”);
document.write(“<A HREF=’JavaScript:pross(” + q + “);’>”);
document.write(facit[q]);
document.write(“</A>”);
document.write(“</DIV></TH>”);
}
</script>
</TR>
</TABLE>
<BR>

<table BORDER=1>

<TR>
<TH>FORFELT</TH>
<TH>VERBUM</TH>
<TH>SUBJEKT</TH>
</TR>
<tbody id=”binding”>

<TR>
<TD id=”c1″ HEIGHT=80></TD>
<TD id=”c2″></TD>
<TD id=”c3″></TD>
</TR>
</tbody>

</TABLE>

</BODY>
</HTML>

to post a comment
JavaScript

27 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceApr 08.2006 — I reworked it quite a bit to suit my needs (and expanded upon the sentence used and the number of parts of a sentence to select from), but the following more than fulfills your request. I also went complete OO on this and created a JavaScript "class" library. The following is the HTML page -- note the include for the "class" library:
[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Language Analyzer</title>
<style type="text/css">
<!--
td {
text-align: center;
}
.hlt {
background-color: #ddd;
color: black;
}
.sel {
cursor: pointer;
color: #00f;
text-decoration: underline;
}
-->
</style>
<script src="LanguageSchema.js" type="text/javascript"></script>
<script type="text/javascript">
<!--//
var schema = new LanguageSchema(9);
schema.setWords("The quick brown fox jumped over the lazy dog.")
//
function processIt(w) {
if(currSchema) {
var s = Number(currSchema.id.substr(1));
currSchema.innerHTML = schema.insertWord(s, w);
s = document.getElementById("word"+w);
s.className = "";
s.onclick = null;
} else alert("Click a schema.");
return true;
}
var currSchema = null;
function hilightIt() {
var q, len = schema.getListsLength();
for(q=0; q<len; ++q) document.getElementById("s"+q).className = "";
currSchema = this;
currSchema.className = "hlt";
return true;
}
window.onload = function () {
var q, len = schema.getListsLength();
for(q=0; q<len; ++q) document.getElementById("s"+q).onclick = hilightIt;
return true;
}
//-->
</script>
</head>

<body>

<script type="text/javascript">
<!--//
var q, len = schema.getWordsLength();
for(q=0; q<len; ++q)
{
document.write('<span id="word', q, '" class="sel" onclick="return processIt(', q, ')">');
document.writeln(schema.getWord(q), '</span>');
}
//-->
</script>

<br><br>

<table border=1>
<tr>
<th colspan="3">Subject</th>
<th colspan="6">Predicate</th>
</tr>
<tr>
<th colspan="3">&nbsp;</th>
<th colspan="2">&nbsp;</th>
<th colspan="4">Prepositional Phrase</th>
</tr>
<tr>
<th>Article</th>
<th>Adjective</th>
<th>Noun</th>
<th>Adverb</th>
<th>Verb</th>
<th>Preposition</th>
<th>Article</th>
<th>Adjective</th>
<th>Object</th>
</tr>
<tr>
<td id="s0" height=40>&nbsp;</td>
<td id="s1">&nbsp;</td>
<td id="s2">&nbsp;</td>
<td id="s3">&nbsp;</td>
<td id="s4">&nbsp;</td>
<td id="s5">&nbsp;</td>
<td id="s6">&nbsp;</td>
<td id="s7">&nbsp;</td>
<td id="s8">&nbsp;</td>
</tr>
</table>

</body>
</html>
[/code]

Place the following in a file called, for example, "LanguageSchema.js":
/*
Title: JavaScript Class for Language Analysis

Object Constructor
------------------

new LanguageSchema(s,str)
This constructor has two semi-optional arguments. The first argument is the
number of lists to maintain within the object and the second argument is a
phrase or sentence from which the words are extracted and stored within the
object. Note that if not specified at the time the object is instantiated,
two of that object's methods (the setLists() and setWords() methods) must
later be invoked before this object can actually be used. Making these
arguments semi-optional, though, lends greater flexibility towards the reuse
of a single object instantiation.

Object Prototype Methods
------------------------

getList(s)
This method returns a string of the words currently stored in the argument-
specified list. If the argument does not represent one of the current lists
in the object, the 'undefined' primitive is returned.

getListLength(s)
This method returns the number of words currently stored in the argument-
specified list. If the argument does not represent one of the current lists
in the object, the 'undefined' primitive is returned.

getListsLength()
This method returns the number of lists stored in the object. May be zero.

getWord(w)
This method returns the argument-specified word. If the argument does not
represent one of the current words in the object, the 'undefined' primitive
is returned.

getWordIndex(word_string)
This method returns the index of the argument-specified word string as found
in the current words in the object. If not found, the 'undefined' primitive
is returned.

getWords()
This method returns a string of the words currently stored in the object. If
their are no words currently stored in the object, the 'undefined' primitive
is returned.

getWordsLength()
This method returns the number of words stored in the object. May be zero.

insertWord(list_index,word_index)
After inserting the argument-specified word into the argument-specified list,
this method returns a string of the words now stored in that argument-
specified list. If either argument does not represent a known element within
the object, the 'undefined' primitive is returned.

removeWord(list_index,word_index)
After removing the argument-specified word from the argument-specified list,
this method returns a string of the words now stored in that argument-
specified list. If either argument does not represent a known element within
the object, the 'undefined' primitive is returned.

setLists(list_count)
Invoking this method destroys any lists currently stored within the object
and sets up a new lists structure. This method is for use either when the
object is first instantiated or for changing over to a new lists structure.

setWords(word_string)
Invoking this method destroys any words currently stored within the object
and sets up a new words structure. This method is for use either when the
object is first instantiated or for changing over to a new words structure.
Note that this method removes all punctuation, numbers, special characters,
and white space characters (blanks, tabs, etc.) before actually extracting
the words from the string.
*/
//
// Do not touch the following unless you know what you're doing.
//
function LanguageSchema(s, str) {
this.setLists(s);
this.setWords(str);
return this;
}
LanguageSchema.prototype.getList = function(s) {
return (this.isListReference(s)) ? this.lists[s].join(" ") : undefined;
}
LanguageSchema.prototype.getListLength = function(s) {
return (this.isListReference(s)) ? this.lists[s].length : undefined;
}
LanguageSchema.prototype.getListsLength = function() {
return this.lists.length;
}
LanguageSchema.prototype.getWord = function(w) {
return (this.isWordReference(w)) ? this.words[w] : undefined;
}
LanguageSchema.prototype.getWordIndex = function(str) {
if(typeof(str) != 'string' || str.length &lt; 1) return undefined;
var q, len = this.getWordsLength();
for(q=0; q&lt;len; ++q) if(this.words[q] == str) break;
return (q&lt;len) ? q : undefined;
}
LanguageSchema.prototype.getWords = function() {
return (this.getWordsLength() &gt; 0) ? this.words.join(" ") : undefined;
}
LanguageSchema.prototype.getWordsLength = function() {
return this.words.length;
}
LanguageSchema.prototype.insertWord = function(s, w) {
if(!this.isListReference(s) || !this.isWordReference(w)) return undefined;
var q, len = this.getListLength(s);
var r, len2 = this.getWordsLength();
for(q=0; q&lt;len; ++q) {
for(r=0; r&lt;len2; ++r) if(this.lists[s][q] == this.words[r]) break;
if(r &gt; w)break;
}
if(q &lt; len) this.lists[s] = this.lists[s].concat(this.lists[s].splice(q, this.lists[s].length-q, this.words[w]));
else this.lists[s].push(this.words[w]);
return this.getList(s);
}
LanguageSchema.prototype.isListReference = function(s) {
if(typeof(s) != 'number' || isNaN(s) || s &lt; 0 || this.getListsLength() &lt;= s) return false;
return true;
}
LanguageSchema.prototype.isWordReference = function(w) {
if(typeof(w) != 'number' || isNaN(w) || w &lt; 0 || this.getWordsLength() &lt;= w) return false;
return true;
}
LanguageSchema.prototype.removeWord = function(s, w) {
if(!this.isListReference(s) || !this.isWordReference(w)) return undefined;
var q, len = this.getListLength(s);
for(q=0; q&lt;len; ++q) if(this.lists[s][q] == this.words[w]) break;
if(len &lt;= q) return undefined;
this.lists[s] = this.lists[s].slice(0,q).concat(this.lists[s].slice(q+1));
return this.getList(s);
}
LanguageSchema.prototype.setLists = function(s) {
this.lists = new Array();
if(typeof(s) != 'number' || isNaN(s) || s &lt; 1 || 99 &lt; s) return false;
this.lists = new Array(s);
var q, len = this.getListsLength();
for(q=0; q&lt;len; ++q) this.lists[q] = new Array();
return true;
}
LanguageSchema.prototype.setWords = function(str) {
this.words = new Array();
if(typeof(str) != 'string') return false;
str = str.replace(/[^a-z ]/gi," ").replace(/s+/g," ").replace(/(^s+)|(s+$)/g,"");
if(str.length &lt; 1) return false;
this.words = str.split(" ");
return true;
}
//
// Do not touch the preceding unless you know what you're doing.
//
Copy linkTweet thisAlerts:
@TarantinoauthorApr 08.2006 — wow- that really works excelent. Thanks a lot.
Copy linkTweet thisAlerts:
@phpnoviceApr 08.2006 — I enhanced it a bit more and reposted above.
Copy linkTweet thisAlerts:
@AltF4Apr 08.2006 — No gloating plz!
Copy linkTweet thisAlerts:
@phpnoviceApr 08.2006 — For even more fun, I went completely OO with it and reposted above.

Cheers.
Copy linkTweet thisAlerts:
@TarantinoauthorApr 08.2006 — Thanks again. Really, really appreciate your effort:-)

My next project is to make the words in the cells clickable- for a "regret" feature. So when the words in the cells are clicked- it moves up to its original place in the sentece and becomes clickable again.

Maybe I can do it myself, but I must admit- there is a lot of commands in your code that I am not familier with.
Copy linkTweet thisAlerts:
@TarantinoauthorApr 08.2006 — afther the test is done- the surfer needs to compare his/her results with results that are stored by me. What are the variables that reflects the choises that are made?
Copy linkTweet thisAlerts:
@phpnoviceApr 08.2006 — My next project is to make the words in the cells clickable- for a "regret" feature. So when the words in the cells are clicked- it moves up to its original place in the sentece and becomes clickable again.

Maybe I can do it myself, but I must admit- there is a lot of commands in your code that I am not familier with.[/QUOTE]

I've reposted a new set of both HTML and code above -- including documentation. This repost is a tightening up of the OO "class" to be as true to OO standards as I know how to make it -- using JavaScript capabilities only. In addition, I've included a new [B]removeWord()[/B] method which takes the same type of arguments as the [B]insertWord()[/B] method. This will help you with your additional desire to create a "regret" feature. I did not, however, include the use of this new method in the HTML shown. I will leave that for you. After all... You need to make some effort here, too, and not just have it all handed to you on a silver platter. Yes? ?

Thanks for the idea, though. I had fun implementing it. ?

afther the test is done- the surfer needs to compare his/her results with results that are stored by me. What are the variables that reflects the choises that are made?[/QUOTE]
You don't need to access any of the variables or properties of the class. Methods are provided to give you everything you need. For example:
[list]
  • [*][B]getListsLength()[/B] returns the number of schemas defined in your class object;

  • [*][B]getListLength(s)[/B] returns the number of words that have been added to a particular schema; and,

  • [*][B]getList(s)[/B] returns a string of the words in a particular schema.
  • [/list]
    Copy linkTweet thisAlerts:
    @phpnoviceApr 08.2006 — Note: I decided to post the class library in expanded form so that the code is easier to look at and to learn from. I also added another method -- getWordIndex(). You'll find all the latest changes in my original post above.

    Cheers.
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — Making progress? I've implemented your "regret" feature in my own page. I was wondering how you're doing on it.
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — Again- I am very thankfull. Your code is excelent. You sure know how to handle your user defined object.

    I have just 1 question- I know its gonna sound like I want you to solve it for me. Thats not the case:-P

    When implanting the remove function- wont I have to do it in the .js file? If I do it in the html file- as far I can see I can only make it clear the entire cell(since I would add the onclick to each cell)- adding it to each word would have to be added to the code that writes it to each cell, no?
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — heh- I had not read your last comment when I posted that. Guess you figured I would run into problems:-)
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — When implanting the remove function- wont I have to do it in the .js file? If I do it in the html file- as far I can see I can only make it clear the entire cell(since I would add the onclick to each cell)- adding it to each word would have to be added to the code that writes it to each cell, no?[/QUOTE]
    The "process" function already re-writes the entire cell content -- so it is no problem to do the same thing with the new "regret" function. I changed the process function to add a link to every word that is to be re-written to the cell each time.
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — The "process" function already re-writes the entire cell content -- so it is no problem to do the same thing with the new "regret" function. I changed the process function to add a link to every word that is to be re-written to the cell each time.[/QUOTE]

    almost works now. Only 1 problem left- getting the removed word to jump back in the list of words. Here is what I do now:

    function processIt(w) {

    if(currSchema) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.insertWord(s, w);

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);

    s.className = "";

    s.onclick = null;

    } else alert("Click a schema.");

    return true;

    }

    function takeIt(w) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.removeWord(s, w)

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);

    s.className = "";

    s.onclick = null;

    }
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — This:

    currSchema.innerHTML = "<A HREF='javascript:takeIt(q)'>" + schema.insertWord(s, w) + "</A>";

    isn't what you want to do. The [b]insertWord()[/b] method returns a string of potentially multiple words. You need a link on each individual word. What I did was to write an additional function which would transform a string of words into mutliple links. Thus, I coded that statement as follows:

    currSchema.innerHTML = makeLinks(s, schema.insertWord(s, w));
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — This:

    currSchema.innerHTML = "<A HREF='javascript:takeIt(q)'>" + schema.insertWord(s, w) + "</A>";

    isn't what you want to do. The [b]insertWord()[/b] method returns a string of potentially multiple words. You need a link on each individual word. What I did was to write an additional function which would transform a string of words into mutliple links. Thus, I coded that statement as follows:

    currSchema.innerHTML = makeLinks(s, schema.insertWord(s, w));[/QUOTE]


    argh- I didnt see this reply- because I keept updating page 1. Sorry for that.

    I did this and it actually both remove and add the links- but its bugged- because once a link has been trough the remove function- it no longer disapear from list when clicked on:

    function processIt(w) {

    if(currSchema) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.insertWord(s, w);

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);

    s.className = "";

    s.onclick = null;

    } else alert("Click a schema.");

    return true;

    }

    function takeIt(w) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.removeWord(s, w)

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);
    document.all["word"+w].innerHTML = "<SPAN ID='word" + w + "' class='sel' onclick='return processIt(" + w + ")'>" + schema.getWord(w) + "</span>";


    }
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — I did this and it actually both remove and add the links- but its bugged- because once a link has been trough the remove function- it no longer disapear from list when clicked on:[/QUOTE]
    I had similar troubles, at first, too. But I found what was causing the problem and remedied it (I couldn't live without my Interactive JavaScript Debugger). Then I had a problem with trying to remove a word that was in a cell which wasn't the currently selected cell. I decided not to go the error message route in that case. My solution, as you may have noted, was to pass the cell index number to my [b]makeLinks()[/b] function:

    makeLinks(s, schema.insertWord(s, w))

    BTW, I note you duplicated the links code in your [b]processIt()[/b] and [b]takeIt()[/b] functions. I wrote a separate function because I'm using the same basic line in my "regret" function:

    makeLinks(s, schema.removeWord(s, w))

    Why write the code twice when you can write it once? ?
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — I had similar troubles, at first, too. But I found what was causing the problem and remedied it (I couldn't live without my Interactive JavaScript Debugger). Then I had a problem with trying to remove a word that was in a cell which wasn't the currently selected cell. I decided not to go the error message route in that case. My solution, as you may have noted, was to pass the cell index number to my [b]makeLinks()[/b] function:

    makeLinks(s, schema.insertWord(s, w))

    BTW, I note you duplicated the links code in your [b]processIt()[/b] and [b]takeIt()[/b] functions. I wrote a separate function because I'm using the same basic line in my "regret" function:

    makeLinks(s, schema.removeWord(s, w))

    Why write the code twice when you can write it once? ?[/QUOTE]


    bud- you lost me on the makelinks thing. There is no makelinks command in the code I have seen.

    I do understand why my code is bugged though. It makes a new span inside the old span with the same name.

    Im not used to working with user defined objects.
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — I managed to do it. Not the smart way though. I think I could do it smarter if I knew how to set "s.onclick =" back once its set to null in processIt. I have tried a lot- but its not working. Ohh well- this works also:

    function processIt(w) {

    if(currSchema) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.insertWord(s, w);

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);

    document.all["word"+w].innerHTML = schema.getWord(w);


    s.className = "";
    s.onclick = null;


    } else alert("Click a schema.");

    return true;

    }

    function takeIt(w) {

    var s = Number(currSchema.id.substr(1));

    var tox = schema.removeWord(s, w)

    var tox_array=tox.split(" ");

    var ntos="";

    var g;

    for (g in tox_array)

    {

    blok = schema.getWordIndex(tox_array[g])

    var ntos = ntos + " " + "<A HREF='javascript:takeIt(" + blok + ")'>" + tox_array[g] + "</A>";

    currSchema.innerHTML = ntos;

    }

    s = document.getElementById("word"+w);

    s.className= "sel";

    document.all["word"+w].innerHTML = "<A HREF='#' onclick='return processIt(" + w + ")'>" + schema.getWord(w) + "</A>";

    }
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — next problem?

    How do I read from the cells?

    When I do "var t=document.getElementById("s"+0);" to set t to what is in cell #0- I get an object.

    How do I extract the content of a cell to a string?
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — ahh- you answered this in a previous post. getList(s) works excelent.

    Btw- I realice you probably dont like my code much- since its not taking full advantage of your objects, but once the whole thing is set up to work as I like it- I will look at the code again and see if I can make it smarter. I still would like to know if its possible to set "s.onclick =" back to what it was before setting it to "null"
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — I mentioned previously that [B]makeLinks()[/B] was an extra function I added to my HTML page for the "regret" feature -- as it is not related to the purpose of the user-defined object. Otherwise, to reverse this:

    s.className = "";

    s.onclick = null;

    I did something similar to this:

    s.className = "sel";

    s.onclick = function() { return processIt(w) };
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 09.2006 — In my language there is 2 basic structures of language syntax. They use 2 different schemes.

    I have a old script that changes the contest of a page by using a pulldown menu- I like this script a lot and I intended to use it to change between the 2 schemes. However it seems that it overrules the language analyzer script. I cant find the conflict myself. You have time to take a looksie?

    :-)
    Copy linkTweet thisAlerts:
    @phpnoviceApr 09.2006 — The [b]onload[/b] you added to the BODY tag is cancelling out this processing:

    window.onload = function() ...etc...
    Copy linkTweet thisAlerts:
    @James_GatkaApr 10.2006 — Thread was RESOLVED without my code.
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 12.2006 — Hey bud. I just noticed a small problem with the script. I need this script for analyzing danish language, but it cant handle our extra letters ((æøå)not sure how they display for you)), but we have 28 letters in our alphabet.

    Any way to solve that?
    Copy linkTweet thisAlerts:
    @TarantinoauthorApr 12.2006 — actually- it might be the script I use to load the variables that is messing up my foreign letters.
    ×

    Success!

    Help @Tarantino spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...