Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[JavaScript] Simple Question


  • From: javascript@xxxxxxxxxx (Filipiak, Bob (Contractor))
  • Subject: [JavaScript] Simple Question
  • Date: Fri, 27 Jul 2001 08:32:18 -0400

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C11698.2C7C2CA0
Content-Type: text/plain;
	charset="big5"

First, go to http://msdn.microsoft.com/scripting/
<http://msdn.microsoft.com/scripting/>  and download the jscript
documentation.
 
AFAIK you problem may be because of the way you are using theName. Try 
document.all.item(theName).style.top=theTrueTop
 
Document.all[] takes an index value.

Bob Filipiak (Contractor)
MCP 

-----Original Message-----
From: proton@xxxxxxxxxx [mailto:proton@xxxxxxxxxx]
Sent: Friday, July 27, 2001 2:02 AM
To: Javascript@xxxxxxxxxx
Subject: [JavaScript] Simple Question


function KB_keepItInIE(theName,theWantTop,theWantLeft)
{
 theRealTop=parseInt(document.body.scrollTop)
 theTrueTop=theWantTop+theRealTop
 document.all[theName].style.top=theTrueTop
 theRealLeft=parseInt(document.body.scrollLeft)
 theTrueLeft=theWantLeft+theRealLeft
 document.all[theName].style.left=theTrueLeft
}

Above is my JavaScript code segment, 
sometimes IE told me document.all[''].style not an object,
sometimes it seems OK!
I got confused and can't find out the problem!!
 
And, where can I find JavaScript Programming Reference for IE?
Thanks for your kindly help!!
 
Best Regards,
Brad Kao
 


------_=_NextPart_001_01C11698.2C7C2CA0
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dbig5">


<META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D589532712-27072001><FONT face=3DArial =
color=3D#0000ff size=3D2>First,=20
go to <A=20
href=3D"http://msdn.microsoft.com/scripting/";>http://msdn.microsoft.com/=
scripting/</A>&nbsp;and=20
download the jscript documentation.</FONT></SPAN></DIV>
<DIV><SPAN class=3D589532712-27072001><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D589532712-27072001><FONT face=3DArial =
color=3D#0000ff size=3D2>AFAIK=20
you problem may be because of the way you are using theName. Try=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D589532712-27072001><FONT=20
face=3DCourier>document.all.item(theName).style.top=3DtheTrueTop</FONT><=
/SPAN></DIV>
<DIV><SPAN class=3D589532712-27072001><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D589532712-27072001><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Document.all[] takes an index value.</FONT></SPAN></DIV>
<P><FONT size=3D2>Bob Filipiak (Contractor)<BR>MCP </FONT></P>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> proton@xxxxxxxxxx =

  [mailto:proton@xxxxxxxxxx]<BR><B>Sent:</B> Friday, July 27, 2001 2:02 =

  AM<BR><B>To:</B> Javascript@xxxxxxxxxx<BR><B>Subject:</B> =
[JavaScript] Simple=20
  Question<BR><BR></FONT></DIV>
  <DIV><FONT face=3DCourier>function=20
  =
KB_keepItInIE(theName,theWantTop,theWantLeft)<BR>{<BR>&nbsp;theRealTop=3D=
parseInt(document.body.scrollTop)<BR>&nbsp;theTrueTop=3DtheWantTop+theRe=
alTop<BR>&nbsp;document.all[theName].style.top=3DtheTrueTop<BR>&nbsp;the=
RealLeft=3DparseInt(document.body.scrollLeft)<BR>&nbsp;theTrueLeft=3Dthe=
WantLeft+theRealLeft<BR>&nbsp;document.all[theName].style.left=3DtheTrue=
Left<BR>}<BR></FONT></DIV>
  <DIV><FONT face=3DCourier>Above is my JavaScript code segment, =
</FONT></DIV>
  <DIV><FONT face=3DCourier>sometimes IE told me document.all[''].style =
not an=20
  object,</FONT></DIV>
  <DIV><FONT face=3DCourier>sometimes it seems OK!</FONT></DIV>
  <DIV><FONT face=3DCourier>I got confused and can't find out the=20
  problem!!</FONT></DIV>
  <DIV><FONT face=3DCourier></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DCourier>And, where can I find JavaScript =
Programming Reference=20
  for IE?</FONT></DIV>
  <DIV><FONT face=3DCourier>Thanks for your kindly help!!</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DCourier>Best Regards,</FONT></DIV>
  <DIV><FONT face=3DCourier>Brad Kao</FONT></DIV>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C11698.2C7C2CA0--