/    Sign up×
Community /Pin to ProfileBookmark

Firefox Display Issue

[B]Works in Internet Explorer but displays incorrectly in Firefox and Safari.[/B]
Is dispalying [object HTMLHeadElement] rather than what I expected. Let me know if you need to see more of the code. This is a large script. A vendor told us this was caused by element ‘paneBody’ not existing or not loaded or being null. I don’t know how to fix. I am a Cobol developer, not a web developer. Any isight would be greatly appreciated! ?

var electionsFrame = null;
var electionsContent = “”;

function writeElectionsContent()
{
electionsFrame.document.getElementById(“paneBody”).innerHTML = electionsContent;
if(event==”annual” || rule_type==”A”) {
electionsFrame.document.getElementById(“paneHeader”).innerHTML = getSeaPhrase(“ELECTIONS_AS_OF”,”BEN”)+’ ‘+newdate;;
}
else {
electionsFrame.document.getElementById(“paneHeader”).innerHTML = getSeaPhrase(“BEN_ELECT”,”BEN”);
}
electionsFrame = null;
electionsContent = “”;

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@SMTSAug 18.2011 — have you put it online. It would help to see a live example of the whole script online. That way I can look the whole thing over and debug it.

Sorry, I'm a very hands-on person. I need to see what the script does and use it to understand the problem.
Copy linkTweet thisAlerts:
@smithgpzauthorAug 18.2011 — SMTS - Thanks for replying. How would I go about putting this online? ?
Copy linkTweet thisAlerts:
@SMTSAug 21.2011 — Well... you'd need a website.

Or some storage space.

try clanteam.com - good free web hosting. You might not want to do that now, though, as it will take up TIME to setup a website.

I just need to know what the script does and what the rest of it looks like to get an idea of what might be wrong.

It sounds like it's an error you made, and that you are trying to access an element without any other requests... (yah. that makes no sense. EXAMPLE TIME!)

[code=html]<div id="hello">HI</div>[/code]

[CODE]<script>alert(document.getElementById('hello'))[/CODE]
The above shows "[object HTMLDivElement]" in my bowser

but
[CODE]<script>alert(document.getElementById('hello').innerHTML)[/CODE]
shows "HI"

~Charles

hope this gives you an idea.
Copy linkTweet thisAlerts:
@DracoMerestAug 22.2011 — The value returned by getSeaPhrase() probably contains the problem.

As Charles pointed out, an object was referenced rather than the value of an attribute.

Many HTML objects have a HEAD element. Making a guess for sake of example, in addition

to the one above, if you ask for the parent of a <TR> you'd be referencing the <TABLE>

object directly without accessing any attributes of the table.
×

Success!

Help @smithgpz 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...