Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 10th, 2007, 04:13 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
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?
Reply With Quote
  #2 (permalink)  
Old October 10th, 2007, 08:34 AM
joefawcett's Avatar
Wrox Author
Points: 9,731, Level: 42
Points: 9,731, Level: 42 Points: 9,731, Level: 42 Points: 9,731, Level: 42
Activity: 8%
Activity: 8% Activity: 8% Activity: 8%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,068
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)
Reply With Quote
  #3 (permalink)  
Old October 10th, 2007, 08:38 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
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 !
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04: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



All times are GMT -4. The time now is 05:17 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.