Forum for users of JoomlaWatch / ExtraWatch for Joomla, Wordpress, Drupal, Magento, Prestashop

JoomlaWatch / ExtraWatch has following features: live real-time visitor statistics, location of your visitors on a map, blocking of users based on bad word list, front-end counters, click heat map, definition of goals and rules, graphs, directory size monitoring, monitoring of increase of database data in time, nightly email reports, interactive HTML5 chart of traffic flow within your website, SEO report with keyword statistics and keyword position trends

Welcome, Guest
Please Login or Register.    Lost Password?

Why does my Javascript function not work?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Why does my Javascript function not work?
#2272
Why does my Javascript function not work? 7 Years ago Karma: 0
I have this function that needs to search for h1, h2, and h3 tags from within a given element id and concatenate together all the innerhtml of any heading tags it finds. If none exist then it will return the title of the page instead.

But i have been getting errors - the latest is

Error: findHeading.getElementsByTagName is not a function
Source File:
Line: 234

Here is my function, can anyone help?
function heading(){

headings = ["h1","h2","h3"];

for(var h=0;h<headings.length;h++){
if(findHeading.indexOf(headings[h] != -1)){
strHeading += findHeading.getElementsByTagName(headings[h]).item(0).innerHTML;
}
}
if(strHeading!= ''){
return strHeading.replace(/ /g, "_");
}
else{
return mainTitle.replacec(/ /g, "_");
}

}









comment gagner de l'argent rapidement - lit gonflable enfant<br><br>Post edited by: shanm, at: 2009/12/01 20:59
shanm (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1