Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript in OutlookToday page

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I want to use JavaScript in my OutlookToday page (which gets shown inside Outlook explorer).

In the document's load event I call the javascript function:

<script language="javascript" type="text/javascript">
function InvokeJS()
{
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
var mailFolder = nameSpace.getDefaultFolder(6);
alert("JavaScript onload successful");
}

</script>

</head>
<body onload="javascript:InvokeJS();">

This code runs successfully when the page re-loads after it is submitted to server, and got back. (As in postback.)

However, when the page opens for the first time, this code fails.

Am I doing anything wrong?
Any pointers?

TIA,
Sheila
 
Am I doing anything wrong?

While it might not fix your problem, you don't need to specify the "javascript:" protocol inside the onload attribute. Using simply "InvokeJS();" is all you need.

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top