To: Reginald Middleton who wrote (17101 ) 2/5/1998 10:52:00 PM From: XiaoYao Read Replies (2) | Respond to of 24154
I read this from other place. It would be interesting since many posters here are teches. ------ An example of Java-induced blindness: I know Javascript and Java aren''t the same, but there's an analogy here that might be interesting: I've been working on building some sample Channels for a new version of WinMag's BrowserTune. Microsoft uses CDF, and this is what I had to add to set up an Active Channel: <a href="channel.cdf"><font size="1">Subscribe via IE4 Active Channel</font></a> But Netscape does *everything* in Java, and here's what it took to set up a Netcaster Channel: <script LANGUAGE="JavaScript"> function needNetcaster() { window.open("http://netcaster.netscape.com/finder/need_netcaster.html","need_netcaster", "width=629,height=400,titlebar=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no, scrollbars=yes"); } function addChannelAPI() { needNetcaster(); } </script> <script LANGUAGE="JavaScript1.2"> var chanURL = "http://www.langa.com"; var chanName = "Langa.Com"; var chanIntervalTime = -6; //max 1380 var chanAbsoluteTime = 60; var chanMaxCacheSize = 1024000; //max 5120000 Kb var chanDepth = 1; //max 2 levels var chanActive = 1; var chanWidthHint = 640; var chanHeightHint = 480; var chanMode = "window"; var chanType = 1; var getChannelObject = null; var addChannel = null; var nc = null; var ncActive = 0; var poller = null; ÿ function activateNetcaster() { nc.activate(); } function netcasterSniffer() { var isClientOK = (navigator.appName == 'Netscape' && navigator.appVersion.substring(0,1) >= 4 ); if(isClientOK == false) { alert('You must be running an application that supports \n"JavaScript 1.2" to subscribe to this channel.'); return; } if (!components["netcaster"]) { alert("This page requires the Netcaster component."); needNetcaster(); } else { nc = components["netcaster"]; if (nc.active == false) { alert("Activating Netscape Netcaster. \n\nPlease click the Add Channel button \nagain after Netcaster has completed\nloading to subscribe to this channel."); activateNetcaster(); } else { ncActive = 1; addChannelAPI(); } } } function addChannelAPI() { if (ncActive == 0) netcasterSniffer(); else { nc = components["netcaster"]; eval("import nc.getChannelObject;"); eval("import nc.addChannel;"); var chan = getChannelObject(); chan.url = chanURL; chan.name = chanName; chan.intervalTime = chanIntervalTime; chan.absoluteTime = chanAbsoluteTime; chan.maxCacheSize = chanMaxCacheSize; chan.depth = chanDepth; chan.active = chanActive; chan.widthHint = chanWidthHint; chan.heightHint = chanHeightHint; chan.mode = chanMode; chan.type = chanType; addChannel(chan); } ncActive = 0; } <script><font size="1"><a HREF="#" onClick="addChannelAPI(); return(false);"> Subscribe via Netscape Netcaster</a></font> And all that code gets downloaded every time you visit the page, whether you're interested in a Channel or not. (Or, the web-builder has to insert a scripting filter to include the above code for when a 4.0 browser grabs the page.) Either way, yuk. JavaScript isn't Java, but I think the above illustrates the kind of problems you run into when you try to use one tool to solve all your problems. Java---and JavaScript--- have their place, but you run into all kinds of problems when you ask either or both to become a kind of universal tool that can do anything. --- YuanQing,