spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column30


Netscape Navigator's Problems

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

As previously discussed, we have found a few serious problems with Netscape Navigator's layers implementation. Although we worked around them, we wanted to summarize what we found. Avoiding these problems in your scripts can save you a lot of debugging and frustration.

The first problem is the inability to call a function after we load a layer with an HTML feed. In both makeFirstPage() and makeSecondPage() functions, any continuation of the function must be done through a delayed execution via the onload event handler. Here is the makeFirstLayer() again:

function makeFirstPage() {
  firstPage = new Layer(Gwidth,canvas);
  firstPage.src = Gsrc;
  upperPage = firstPage;
  firstPage.onload = makeSecondPage;
  firstPage.onMouseOver = stopScrolling;
  firstPage.onMouseOut = scrollPages;  
}

Any attempt to call the makeSecondPage() directly and immediately, or any call to any function for that matter, will result in a broken scroller.

The same problem applies in the makeSecondPage() function:

function makeSecondPage() {
  secondPage = new Layer(Gwidth,canvas);
  secondPage.src=Gsrc;
  secondPage.onMouseOver = stopScrolling;
  secondPage.onMouseOut = scrollPages;
  lowerPage = secondPage;
  secondPage.onLoad = launchScroller;
}

Any attempt to call the launchScroller() immediately and directly, or any other function for this matter, will result in a broken scroller.

The third problem is the need to return true from the rotatePages() function:

function rotatePages() {
        if (upperPage == firstPage) {
        upperPage = secondPage;
        lowerPage =firstPage;
        return true;
        }
        upperPage=firstPage;
        lowerPage=secondPage;
        return true;
}

Any attempt to remove the return true; statements will break the scroller after a few cycles.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: November 23, 1998
Revised: November 23, 1998

URL: http://www.webreference.com/js/column30/problems