PDA

View Full Version : Help With A Java Script



-=Cyrus=-
02-24-2004, 10:46 PM
:) I am wanting to control the font size of the following, what and where do i need to add the code as i have tried but nuthing has worked.

<script language=JavaScript>
var txt = "Add To Favorites";
var url = "mysite.com";
var who = "-sitename-";
var ver = navigator.appName;
var num = parseInt(navigator.appVersion);
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write(''+ txt + ' (javascript:window.external.AddFavorite(url,who);)');
}else{
txt += " (Ctrl+D)";
document.write(txt);
}
</script>

Thanks

h1
02-24-2004, 11:06 PM
Put this in the <head> section...

&#60;script type=&#34;text/javascript&#34;&#62;
&nbsp; function bookmark&#40;&#41;
&nbsp; &nbsp; &nbsp;{
&nbsp; &nbsp; &nbsp;if&#40;&#40;navigator.userAgent.toLowerCase&#40;&#41;&#41;.indexOf&#40;&#34;msie&#34;&#41;&#33;=-1&#41;
&nbsp; &nbsp; &nbsp;{
&nbsp; &nbsp; &nbsp; &nbsp; window.external.AddFavorite&#40;&#34;http&#58;//www.yoursite.com&#34;,&#34;Your Site&#34;&#41;;
&nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp; &nbsp;else
&nbsp; &nbsp; &nbsp;{
&nbsp; &nbsp; &nbsp; &nbsp; alert&#40;&#34;This link will work only in Internet Explorer.&#34;&#41;;
&nbsp; &nbsp; &nbsp;}
&nbsp; }
&nbsp; function over&#40;&#41;
&nbsp; {
&nbsp; &nbsp; &nbsp;window.status=&#34;The text you want to see in the status bar&#34;;
&nbsp; &nbsp; &nbsp;return true;
&nbsp; }
&nbsp; function out&#40;&#41;
&nbsp; {
&nbsp; &nbsp; &nbsp;window.status=&#34; &#34;;
&nbsp; &nbsp; &nbsp;return true;
&nbsp; }
&#60;/script&#62;
Then, use this as the link...

&#60;a href=&#34;javascript&#58;void&#40;0&#41;;&#34; onmouseover=&#34;over&#40;&#41;;&#34; onmouseout=&#34;out&#40;&#41;;&#34; onclick=&#34;bookmark&#40;&#41;;&#34;&#62;Click here to bookmark this page.&#60;/a&#62;
Hope this helps. :)

-=Cyrus=-
02-24-2004, 11:13 PM
Thanks :) I will go and try it now :)

h1
02-24-2004, 11:22 PM
Fuck, I just noticed an error. Went back and edited the original post.

-=Cyrus=-
02-25-2004, 05:44 PM
Thanks for your help :D the edited one works now :D

Thanks again,

-=Cyrus=-

h1
02-25-2004, 10:55 PM
NP. :)