/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Defining an object

I have a web page at:

[url]http://myweb.tiscali.co.uk/spiresgate/StEdwardsWeb/pupils.htm[/url]

which has clean HTML according to Tidy and validates according to W3C.

However, I have an ‘error on page’ message (bottom left-hand corner) which reads ‘Inn’ is undefined. I have tracked down to the external javascript file. The lines it doesn’t like are:

Inn.style.top = 150 + 90 – tempY*4;
Inn.style.left = 100 + 90 – tempX*4;

How do I define this object Inn?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 07.2008 — What are you using the cursor position values for?
Copy linkTweet thisAlerts:
@spiresgateauthorJul 07.2008 — Good question.

The external file is used for other pages on the site. The user moves the cursor over a group photograph and a magnification of that part of the picture is seen in a separate box. For example at:

http://myweb.tiscali.co.uk/spiresgate/StEdwardsWeb/2alpha.htm
Copy linkTweet thisAlerts:
@FangJul 07.2008 — This is one way to solve it:if(document.getElementById('Inn')) {
var Inn=document.getElementById('Inn');
Inn.style.top = 150 + 90 - tempY*4;
Inn.style.left = 100 + 90 - tempX*4;
}

You also have a problem on 2alpha.htm as the image name [I]Oldtimes[/I] does not exist.
Copy linkTweet thisAlerts:
@spiresgateauthorJul 07.2008 — Thanks very much Fang. That seems to have done it. I should be able to put similar errors right with this new 'learnings'.
×

Success!

Help @spiresgate 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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