Cross-Platform Position Scripting
Reconciling the differences between the object and rendering models of Navigator 4 and Internet Explorer 4 is one of the biggest challenges you face if you want to script positionable elements for both platforms in the same HTML document. The key factors to take into account are:
How to address positionable elements when the object references are so vastly different
How to make adjustments to differently named properties in a truly interactive and dynamic environment
You cannot avoid having your scripts branch to execute platform-specific statements. What you must decide for your application is how and where the branching occurs. There are three basic techniques you can use to implement cross-platform position scripting in a document:
Explicit branching
Platform-equivalent referencing
Custom APIs
Explicit branching and platform-equivalent referencing place the branching code directly in your scripts. For a limited amount of scripted positioning, having all the branching code in your scripts is manageable and actually easier to debug. But if you are doing a serious amounts of scripted positioning, a custom API lets you push the ugly branching code off to the side in an external library. In essence, you create a meta-language that gives you control over the specific syntax used in both browsers. A custom API requires a lot more work up front, but once the API code is debugged, the API simplifies not only the current scripting job, but any subsequent ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access