p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > JavaScript > Javascript How-To
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 10th, 2007, 08:34 AM
joefawcett's Avatar
Wrox Author
Points: 8,994, Level: 40
Points: 8,994, Level: 40 Points: 8,994, Level: 40 Points: 8,994, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 01:15 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc