JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 23rd, 2003, 01:04 PM
NRS NRS is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 0 NRS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
JS text color prob in Nscape

I have a bookmark script on my page which displays text in the intended green color in IE but the ctrl D comment for netscape users is in black only which will not show up on my dark bkgr pages. Since I am not going to change the background, is there a way to make the NS comment to be in a color which WILL show up? this code uses a text message as well as a graphic. code is below:

<div id="bookmark" style="position:absolute; left:200px; top:200px; width:200px; height:69px; z-index:10">
<body link="#66CC66" vlink="#66CC66" alink="#999999">
<font size="2" face="Arial">
<script>
var txt = " <img src='images/its_favicon.gif' border='0'><br>Bookmark something"
var url = "http://www.something.com";
var who = "ITS"
var ver = navigator.appName
var num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=')
document.write("txt; return true ")
document.write('"onMouseOut=" window.status=')
document.write("' '; return true ")
document.write('">'+ txt + '</a>')
}else{
txt += " (Ctrl+D)"
document.write(txt)
}
</script></font>
</div>

Reply With Quote
  #2  
Old March 23rd, 2003, 11:15 PM
Invoked Invoked is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 Invoked User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Since its not a link and the color is based upon your a attributes in the body tag it isn't working. There's a way around it though if you include a fontcolor() method at the end of the txt string:

Code:

<script> 
var txt = " <img src='images/its_favicon.gif' border='0'>"
txt += "<br>Bookmark something".fontcolor('#66cc66');   
var url = "http://www.something.com"; 
var who = "ITS" 
var ver = navigator.appName 
var num = parseInt(navigator.appVersion) 
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) { 
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" '); 
document.write('onMouseOver=" window.status=') 
document.write("txt; return true ") 
document.write('"onMouseOut=" window.status=') 
document.write("' '; return true ") 
document.write('">'+ txt + '</a>') 
}else{ 
txt += " (Ctrl+D)".fontcolor('#66cc66');  
document.write(txt) 
} 
</script>


- Invoked

Last edited by Invoked : March 23rd, 2003 at 11:20 PM.

Reply With Quote
  #3  
Old March 24th, 2003, 12:38 AM
NRS NRS is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 0 NRS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
THANK YOU! ...Much Appreciated! Hope i can return the favor.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > JS text color prob in Nscape


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap