Referencing an Attribute of the Calling Object
- From: Artist <artist@xxxxxxxxxxxxxxxx>
- Date: Mon, 23 Jan 2006 00:55:34 -0800
In the "imgSizeChange()" function below gets the error:
Microsoft JScript runtime error: 'imgSizeChange.caller.width' is null or not an object
The thread 'Thread 5C0' (0x5c0) has exited with code 0 (0x0).
The program '[1860] iexplore.exe: Script program' has exited with code 0 (0x0).
What is the correct way to get to the attributes of any img tag that calls "imgSizeChange()" ? Will it be necessary to explicitly pass the "img1" id to "imgSizeChange()" ?
<head> <script id=clientEventHandlersJS language=javascript> <!--
lDim = 800;
sDim = 600;
function imgSizeChange()
{ if( imgSizeChange.caller.width === 1280 )
{ imgSizeChange.caller.width = lDim;
imgSizeChange.caller.height = sDim;
}
else
{ imgSizeChange.caller.width = 1280;
imgSizeChange.caller.height = 960;
}
}
-->
<script>
</head>
<body>
<IMG id="Img1" alt="" src="00009 2004-05-15 16_05_58.JPG"
width="1280" height="960" language=javascript
onclick="return imgSizeChange()"
>
</body>-- If sj. appears in my email address remove it to respond directly. It is a spam jammer.
.
- Prev by Date: Re: Referencing the Calling Object
- Next by Date: Re: Best Way to access Input fields
- Previous by thread: Referencing the Calling Object
- Next by thread: "Loading Window" page
- Index(es):
Relevant Pages
|