Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2007, 03:13 AM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript in Outlook (2003) message

I've found the javascript function ShowHide on the web.
Code:
<SCRIPT>
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}
</SCRIPT>
when I insert this code in an HTML-document it works just fine in IE 6.0 (version @ work)
Code:
<UL>
<LI>
<A onclick="showhide('K230'); return(false);" href="#">1. Title Item 1</A> 
<DIV id=K230 style="DISPLAY: none">Hidden text of Item 1</DIV>
<LI>
<A onclick="showhide('K231'); return(false);" href="#">2. Title Item 2</A> 
<DIV id=K231 style="DISPLAY: none">Hidden text of Item 2</DIV>
</UL>
when I use this code in an HTML-formatted message, the script won't execute and the text won't appear when I click the link.


Anyone knows what I'm doing wrong?
 
Old October 10th, 2007, 07:34 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Allowing script to run in email messages is both a security risk and normally not wanted by the recipient. It maybe possible by altering the machine's security settings but is disabled by default.

--

Joe (Microsoft MVP - XML)
 
Old October 10th, 2007, 07:38 AM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Joe, thanks for the answer.

I was afraid it was a security-problem.

Someone might have an idea how to do a similar thing while using only HTML & CSS?

tnx !





Similar Threads
Thread Thread Starter Forum Replies Last Post
Link in Outlook Message forkhead HTML Code Clinic 0 March 6th, 2008 02:56 PM
Outlook 2003 Angel_oct11 C# 2005 2 November 13th, 2007 07:08 AM
Outlook 2003 Email into Access annienml Access VBA 3 March 28th, 2007 03:51 AM
Outlook 2003 Hunter Pro VB.NET 2002/2003 0 January 5th, 2005 06:01 PM
Create outlook 2003 distributionlist Alcapone C# 2 December 22nd, 2004 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.