JavaRanch » Java Forums »
Engineering »
HTML, CSS and JavaScript
| Author |
Getting the top 3 keywords from a text content
|
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Guys,
I run into some problems when I execute the following javascript at the line mentioned inline in the source code below,
Can you please help me out?
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
Jothi Shankar Kumar wrote:I run into some problems when I execute the following javascript ...
Does your keyboard burst into flame?
(In other words, just telling us "you have a problem" doesn't do anything to tell us what it is.)
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Yes, I have mentioned the problem as an inline comment in the code above. It gives me an Object Expected javascript error in the line
<input type="submit" name="Submit" value="Calculate Keyword Density" onclick="javascript: count('txtId');">
which I do not understand.
Actually, I'm trying to identify the top 3 words that are being used in the textarea. I'm filtering out the unwanted words which I cann stopwords and finding out the density and based on the density, populate the array of top 3 words. Any ideas on why I get an Object Expected javascript error?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
Jothi Shankar Kumar wrote:Yes, I have mentioned the problem as an inline comment in the code above.
Not a great approach. the harder you make it for people to help you, the less help you are likely to receive.
onclick="javascript: count('txtId');">
What's with the completely unnecessary "javascript:" prefix?
And why should you be surprised that it doesn't know what "count" is when such a function is never defined?
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Thanks for pointing that out. But even after giving the correct method name and removing the javascript:, I keep getting the same error.
It looks like this now,
<input type="submit" name="Submit" value="Calculate Keyword Density" onclick="calculateKeywordDensity('txtId');">
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
|
That's not defined either.
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
Yes, corrected the spelling mistake. Later I figured out that I was missing a closing brace in one of the lines inside the calculateKeywordDensity function.
|
 |
 |
|
|
subject: Getting the top 3 keywords from a text content
|
|
|
|