donmorr
04-22-2009, 08:04 AM
Hello All,
I'm having trouble putting the javascript for the Cool DHTML Tooltip into an external js file.
I keep getting an error saying that tipobj is not defined in the js file.
Here is the html code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Hub Status</title>
<meta name="generator" content="Namo WebEditor v4.0">
<style><!--
-->
</style>
<!-- CSS -->
<style type="text/css">
#dhtmltooltip
{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
}
</style>
<!-- Java scripts: -->
<script type="text/javascript" src=js/hoverText.js>
</script>
<meta http-equiv="refresh" content="5">
</head>
<body bgcolor="white" text="#008894" link="blue" vlink="purple" alink="red">
<div id="dhtmltooltip"></div>
...
</body>
I'm guessing that the following line in the js file is not assigning tipobj for some reason:
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
Does anyone know why? Do I need to 'link' the external js file to the html file in some way? (Sorry, I'm new to javascript & html!)
Cheers in advance,
Don
I'm having trouble putting the javascript for the Cool DHTML Tooltip into an external js file.
I keep getting an error saying that tipobj is not defined in the js file.
Here is the html code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Hub Status</title>
<meta name="generator" content="Namo WebEditor v4.0">
<style><!--
-->
</style>
<!-- CSS -->
<style type="text/css">
#dhtmltooltip
{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
}
</style>
<!-- Java scripts: -->
<script type="text/javascript" src=js/hoverText.js>
</script>
<meta http-equiv="refresh" content="5">
</head>
<body bgcolor="white" text="#008894" link="blue" vlink="purple" alink="red">
<div id="dhtmltooltip"></div>
...
</body>
I'm guessing that the following line in the js file is not assigning tipobj for some reason:
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
Does anyone know why? Do I need to 'link' the external js file to the html file in some way? (Sorry, I'm new to javascript & html!)
Cheers in advance,
Don