473,657 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NN 4.0+ i/layer self-awareness

PAD
I have written a javascript routine that populates a parent document
with a series of <iframe>s. Each <iframe> receives its contents from a
series of separate smaller HTML files. Of course my NN 4.8 browser
doesn't deal well with the <iframe> so I wrapped the code that generates
the <iframe> in <ilayer> tags. NN now recognizes the contents.

However within each of the 'content' files I have another javascript
routine that basically displays the file name (via document.URL &
document.write) of the content file. My IE 5.5 & Mozilla 1.5
understands this perfectly. However my NN responds to the document.URL
with the wrapper/parent document's URL, not it's own unique file name.

I've named/ID'd the iframes & ilayers. If the document.URL fails I can
still make use of the ilayer ID but I need to know the index into the
layers array. I can hard-code a index value into the
document.layers[x].name but given that the position of the particular
content file is dynamic within the parent, the index is going to be
wrong 9 out of 10 times. There doesn't seem to any way for an i/layer
to know who it is...

I've looked through my books (O'Reilly Javascript 1.5 and a couple
D/HTML books), plus the 'Net (event the FAQ's from this NG) and have
found nothing about how the NN 4.0 failure (to my way of thinking ;-)
can be resolved. While I calculate about 1% of the site visitors will
use the old NN 4.0+ browsers... it has now become something of a crusade
of mine LOL
The content files have <head</head><body></body> tags but no
<html></html> tags. I've tried removing the <head> tags and/or
including the <html> tags but it seems to have no effect.

Here is the code that generates the layers/frames within the parent
document (other than this code in a JS file, there's nothing fancy
within the parent. ie it's isn't framed - just plain HTML). This
snippet of code is done 10 times for each parent page...

lno - is the uniqueness identifier for each content file. It's a
sequence number but there are gaps in the sequence. So 123rbe.html is
not going to follow 122rbe.html nor will 124 follow 123.

html = html + '<ilayer ID=\'fy'+ lno + '\' SRC=\'rbk/' + lno +
'rbe.html\'></ilayer><nolayer >';
html = html + '<iframe ID=\'fy'+ lno + '\' SRC=\'rbk/' + lno +
'rbe.html?inp=r bk\' BORDER=0 +
HEIGHT=\'250\' WIDTH=\'100%\' FRAMEBORDER=\'1 \' MARGINWIDTH=0
MARGINHEIGHT=0> </iframe>';
html = html + '</nolayer>';
html = html + '<br>';
Thanks for any help!
Pete

Jul 20 '05 #1
1 1929
since nobody else is answering this question, i guess i will...

PAD wrote:

I have written a javascript routine that populates a parent document
with a series of <iframe>s. Each <iframe> receives its contents from a
series of separate smaller HTML files. Of course my NN 4.8 browser
doesn't deal well with the <iframe> so I wrapped the code that generates
the <iframe> in <ilayer> tags. NN now recognizes the contents.
<layer> would be better -- there are rendering discrepencies/problems
with ilayer. <layer> will "behave" like an ilayer if you leave out the
top and left properties when setting it up.

However within each of the 'content' files I have another javascript
routine that basically displays the file name (via document.URL &
document.write) of the content file. My IE 5.5 & Mozilla 1.5
understands this perfectly. However my NN responds to the document.URL
with the wrapper/parent document's URL, not it's own unique file name.

I've named/ID'd the iframes & ilayers.
with <layer> only ID would be necessary. Layers are position absolute by
default (although they will be positioned "inline" so-to-speak if you do
not apply top and left properties. If you've nested layers and require
setting the top and left values for positioning, specify
style="position : relative;" for the layer to make it behave as an ilayer.

in general, avoid ilayer...
If the document.URL fails I can
still make use of the ilayer ID but I need to know the index into the
layers array.
no you don't...

for the url, use this.src (from within the loaded document).
for the id of the layer used to contain the loaded document, use this.id
[this.name is also available IF it was used in the tag] from within the
loaded document.

parent doc:

<layer id = holder src = "whatever.h tm" attributes...>
</layer>
<!-- works with layer/ilayer -->

whatever.htm:

<html>
<head>
</head>
<body>
<script>
document.write( this.src); // prints: file:///HD/pathto/"whatever.h tm"
</script>
</body>
</html>

an alternative would be:

<html>
<script>
onload = function()
{
// dynamically set the content
document.layers .holder.src = "whatever.h tm";
}
</script>
<body>

<layer id = holder attributes...></layer>
</body>
</html>

you get the same results... with layer only, not ilayer.
....no hardcoding necessary.
I can hard-code a index value into the
document.layers[x].name but given that the position of the particular
content file is dynamic within the parent, the index is going to be
wrong 9 out of 10 times. There doesn't seem to any way for an i/layer
to know who it is...

I've looked through my books (O'Reilly Javascript 1.5 and a couple
D/HTML books), plus the 'Net (event the FAQ's from this NG) and have
found nothing about how the NN 4.0 failure (to my way of thinking ;-)
can be resolved. While I calculate about 1% of the site visitors will
use the old NN 4.0+ browsers... it has now become something of a crusade
of mine LOL
for..in is your best friend for sniffing out properties...

it's possible to provide an extensive amount of new DOM support to
NN4...if you're on that much of a crusade... like
document.getEle mentById and even innerHTML if you're really fanatical
(settable, not really readable without a very cumbersome workaround).
NN4 is fast enough to handle the extra code without noticeably slowing down.

However, take it from a chronic addicted NN4 user... it ain't really
worth it... All of us "hanger's on" like specific things about nn4,
like, the mail and news readers and, for most sites, it still works well
enough, plus, it's smaller than the newer generations... but truth be
told, I spend most of my time online with 2, maybe 3 (or more) browsers
open at the same time... if I run into a site that gives me problems in
NN4 -- it's *expected* (these days) -- and I just copy and paste the URL
into a newer browser for that specific site. I'm a professional site
designer and I gave up providing support for NN4 over 6 months ago
(which, for me, is a simple drop of a library into the document and
tweaking a couple of exceptions in the code).

for a demo of new DOM for ol' NN4, check out: http://fxmahoney.com/joshkelley

this site was originally developed without NN4 support, so you'll need
to visit it in NN4 and IE5+/NN6+ separately [I was originally told NN4
support was not necessary...but somebody's wires got crossed...] --
however, you'll see from the main code, very little alteration was made
to accommodate NN4 from the original new DOM code. [ps - i am not
responsible for the design of that page, only the programming]

click the link to Enter Site and View Source on the popped up
document... all of the new DOM support needed for that document (in the
NN4 version) was copied and pasted into that document with the exception
of the link rollover code which is in a separate .js doc [which can be
grabbed with one of the newer browsers by pasting the url into the
location]. There is enough there to give you a huge leg up on writing
your own support code. [do NOT write me and ask about how to proceed or
why I did what I did...you have to figure it out for yourself -- i did
my time with nn4... just pay attention to the watch method and the way
you read css attributes in NN4... and the fact that you can make up your
own css attributes and nn4 will happily accumulate them into the
stylesheet while all new browsers "sanitize" attributes they don't
understand. example:

#mydiv {
position: absolute;
use-class: myclass; /* access in NN4 to which class combined */
}

..myclass {
... more attributes
}
in NN4 you can relate .myclass attributes within a layer from the
"stuffed" attribute in the ID -- this is useful, along with the watch
method, in constructing a usable innerHTML method that can change the
content of a layer (you have to completely reconstruct all the styles
before document.writin g to the layer -- and you will still not be able
to read the actual HTML of a layer -- you'll have to store a copy in a
variable or create a property of the layer in use:

myLayer.html = htmlStr;

but this is more trouble than it's worth and usually not necessary.)

]
[remember the rule about css <-> jss naming -- what is use-class in css
becomes useClass in jss...]

okay...

JSS style sheets are accessed in NN4 as:

IDs [ex: #myID { attributes } ]

document.ids.my ID.attribute
or
document.ids["myID"].attribute

Classes [ex: .myClass {attributes} ]

document.classe s.myClass.all.a ttributes or
document.classe s["myClass"].all.attributes

where all should normally be used, but can be substituted with a TAG
name, like:

document.classe s.myClass.DIV.a ttributes

// in NN4, you will run into all kinds of problems with links and tables...
// best to plan your CSS as "generally" as possible...
// meaning: use all, all the time if you plan to support nn4

Tags:

document.tags.T AGNAME.attribut e [ex: document.tags.D IV.attribute]
TAGNAME, I believe, has to be all uppercase.

There's supposed to be a way to get at contextuals, but I was never able
to nail that one down...Martin Honnen might know this one.

BTW, all of these are settable as well as gettable (even the custom
attributes)... but setting them ONLY works BEFORE the page loads, and
before the items using the styles will be rendered [which means, at the
top of a <script> executed before the <body> tag opens -- the perfect
place to make "adjustment s" and "repairs" to NN4 CSS]


The content files have <head</head><body></body> tags but no
<html></html> tags. I've tried removing the <head> tags and/or
including the <html> tags but it seems to have no effect.
they're expected in "well-formed" documents...lea ve them in.

Here is the code that generates the layers/frames within the parent
document (other than this code in a JS file, there's nothing fancy
within the parent. ie it's isn't framed - just plain HTML). This
snippet of code is done 10 times for each parent page...

lno - is the uniqueness identifier for each content file. It's a
sequence number but there are gaps in the sequence. So 123rbe.html is
not going to follow 122rbe.html nor will 124 follow 123.

html = html + '<ilayer ID=\'fy'+ lno + '\' SRC=\'rbk/' + lno +
'rbe.html\'></ilayer><nolayer >';
html = html + '<iframe ID=\'fy'+ lno + '\' SRC=\'rbk/' + lno +
'rbe.html?inp=r bk\' BORDER=0 +
HEIGHT=\'250\' WIDTH=\'100%\' FRAMEBORDER=\'1 \' MARGINWIDTH=0
MARGINHEIGHT=0> </iframe>';
html = html + '</nolayer>';
html = html + '<br>';
this looks more complicated than it needs to be...

here's a tip -- in HTML, you don't need quotes unless there are spaces
involved, so:

id = somename or id = "some name" or id = 'some name'
width = 100% or width = "100%" // or with singles
etc...

so then:

html += "<layer id = fy" + lno + " src = rbk" + lno +
"rbe.html width=100% height=250></layer>" ...


Thanks for any help!
Pete


Very good luck, Pete...if nothing else, this is a very good programming
exercise for you and you will learn a considerable amount about the
inner workings of DOM elements (past and present). I have it on very
good authority that the .watch() method is still available in NN6+ and
will continue to be supported for the foreseeable future... it is an
exceptionally powerful tool...(and not available in IE)

Also, none of what you are about to embark on is in any book and there
is only very sketchy documentation available [only that the JSS
stylesheets can be accessed with that outlined above], so you'll have to
ferret all this stuff out yourself [for..in everything -- find out
what's there and how it changes and what you can make changes to...]

that joshkelley page only uses a document.getEle mentById for top level
layers... here's a more general version that will work with embedded
layers (and only the most commonly used getter/setters [well, except for clip]):

// there are no guarantees with the following
// use as a starting point for more extensive support

// You might want to turn off line-wrapping in your reader and reopen
this post
// to get the following -- it was copied from my original source code
and not
// intended to be posted on this ng

if(document.lay ers)
{

document.getEle mentById = function(name)
{

var matchedLayer = null;

recurseLayers = function(w, match)
{
if(w.document.l ayers[match])
matchedLayer = w.document.laye rs[match];
else
{
for(var i = 0; i < w.document.laye rs.length; i++)
recurseLayers(w .document.layer s[i], match);
}
}

recurseLayers(w indow, name);

if(matchedLayer ) // make this like new DOM:
{
if(!matchedLaye r.style)
{

matchedLayer.st yle = new Style(matchedLa yer);
}

}

return matchedLayer;

}

function Style(ref)
{

this.parent = ref;
this.watch("top ", function(i,o,n)
{
this.parent.top =
this.parent.off setTop = n;
return n;
}
);

this.watch("lef t", function(i,o,n)
{
this.parent.lef t =
this.parent.off setLeft = n;
return n;
}
);
this.watch("cli p", function(i,o,n)
{

var set = n.match(/\d+/g);

var lyr = this.parent;
lyr.clip.top = set[0];
lyr.clip.right = set[1];
lyr.clip.bottom = set[2];
lyr.clip.left = set[3];
return n;
}
);

this.watch("vis ibility", function(i,o,n)
{

this.parent.vis ibility = n;

return n;
}
);
}

}

You might also want to adopt that document.getIma geByName routine (from
/joshkelley) to make backwards support with NN4 more general with new
browsers -- it follows the new DOM convention...
okay... i'm done.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4008
by: DS | last post by:
Is there a way to automatically close the data reader connection? I'm using the MS Data Access Application block to substantially {entirely} separate the data access layer (DAL) from the business layer (BL) and this is great with DataSets since they can be closed off in the DAL, but it doesn't seem possible with the DataReader since it would need to be .close() in the BL once I'm done with it. I've read on the web that there is a bit of...
2
2207
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to access the database layer. However, the code works in a pretty cumbersome and ungeneric way. Basically every query, update, and insert has its own function. So you see a lot of functions like webService.InsertCustomer(name, age, phone); or...
8
8543
by: Rashmi | last post by:
Hi! I am new to web services. AFAIK, the advantages of using web services are : interoperable, easy integration and reuse, text based protocols and data formats - SOAP,WSDL,XML. Also, I read this article: http://www.theserverside.net/articles/showarticle.tss?id=Top5WSMistakes I agree with everything this article says. Is there anyone (or anylink) which proves otherwise? I have read quite a few times about using web
2
2351
by: dkode | last post by:
Hello, I am laying out the architecture for a very large website that will scale to a very large degree. I have a couple of questions before I attempt to go and implement a Broker/Persistence Layer. 1. With a broker layer, does this layer sit at the same level as the Business Layer? So to speak, the presentation layer has knowledge of
1
1611
by: rbg | last post by:
Hi, I am trying to understand the layering concept with the ASP.NET 2.0 apps. I have a ASP.NET 2.0 Web app which has 3 layers Presentation layer which contains UI elements and Input validation logic
16
9018
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
16
2367
by: Dotnet | last post by:
I want to so the "right thing". But first, I have a confession to make. I've built a few ASP.NET sites now (Version 2.0), and they all work fine. However, I have (and here's the confession) used the SqlDataSource in each one of them. I've read a number of blogs and articles that tell me this is just, well, sinful. I have to adopt an n-layer/tier approach which makes use of a Data Access Layer and a Business Logic Layer. I've...
8
2301
by: andre rodier | last post by:
Hello, As indicated in the title, I am looking for a PHP library able to create on the fly complex SQL requests, on 5 or 6 dimensions, without problems occurs on many-to-many relations, etc. Thanks
1
3080
by: Tobias Grimm | last post by:
Hi! I'm trying to get a WebService running (self hosting, without IIS) that uses SSL and loads the SSL key/certificate from a file (without using httpcfg.exe). I have a running service and netstat shows a listening https interface, but I can't access the service or the wsdl meta data. Any ideas, what's going wrong here (see code below)?
4
1902
by: Spam Catcher | last post by:
Hi all, I'm building a multi-tier web application that is primarily driven by a web service back end. Are there any configuration settings I should know about to increase the performance of the site? For example, if the site is going to service 100+ users, do I need to do anything special to ensure IIS can contact my back-end webservice at the
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.