From JHuebner08 at student.mvcc.edu Fri Apr 1 07:14:12 2005 From: JHuebner08 at student.mvcc.edu (John Huebner) Date: Fri, 1 Apr 2005 08:14:12 -0500 Subject: [Javascript] writing to iframe Message-ID: <6C71C1ACF8C70F4E96C54B28A790D8550299DBAC@STUDENT.mvcclabs.edu> An HTML attachment was scrubbed... URL: From and-babble at doxdesk.com Fri Apr 1 12:52:34 2005 From: and-babble at doxdesk.com (Andrew Clover) Date: Sat, 02 Apr 2005 03:52:34 +0900 Subject: [Javascript] Re: scrollbars In-Reply-To: References: Message-ID: <424D9872.6040607@doxdesk.com> Dash wrote: > ok, i modified the script to make it work. In the body tag of the page, > i've defined style="overflow:hidden;", so surely i dont need to check > for document.documentElement (if it's defined in the html file in the > body tag, it wouldn't shift anywhere else, would it?). document.documentElement actually refers to the root element - you would need to put the style in as well to have the same effect as the script version. The issue is that IE6/Standards makes the element represent the viewport, whilst IE5 and IE6/Quirks makes the element represent the viewport. The style has to be applied to the correct element (or both) to make the vertical scrollbar go away in IE/Win. Other browsers (correctly according to spec) don't have an element to represent the viewport; instead the viewport is 'above' the root element () and can't be touched with CSS, though since it only displays a scrollbar when there's too much vertical content to fit on-screen this isn't generally a problem. To actually get rid of 'necessary' scrollbars in all browsers is harder than just fixing IE/Win's unnecessary ones. You'd need to set a block to "overflow: hidden" *and* ensure that its height was the same as the viewport, which is trickier than it sounds: there is no reliable standards-compliant cross-browser-compatible way to give an element 'height: 100%' of the viewport. You can do it for many browsers (not IE/Win) in a standards-compliant way using 'position: fixed; height: 100%', and for many browsers (not IE/Mac) in a not-quite-standards-compliant way using 'position: absolute; height: 100%'. Any way you slice it you'll end up with browser hacks. Alternatively if you know the height of the content (eg. it's images or unwrapped fixed-size text) you could simply put the lot in a
with hidden overflow and a fixed-size height. > I want to be able to do this because i dont want the user to be able to > scroll down the page until an event occurs. Overflow is probably not a good mechanism for doing this. Some browsers would still let you access the hidden content (possibly accidentally) through keyboard control, for example. Not to mention very large screen resolutions. Any reason you couldn't just use a simple hidden
that gets displayed when the event occurs? -- Andrew Clover mailto:and at doxdesk.com http://www.doxdesk.com/ From postmaster at LaTech.edu Fri Apr 1 12:52:38 2005 From: postmaster at LaTech.edu (postmaster at LaTech.edu) Date: Fri, 1 Apr 2005 13:52:38 -0500 Subject: Autoreply: Re: [Javascript] Re: scrollbars Message-ID: The Mailbox davecline is currently unavailable. It is in deactivated state and is not receiving mails. Your message reads: Received: from tank.electric.net (unverified [216.129.90.111]) by ucmmail.com (Rockliffe SMTPRA 6.1.17) with ESMTP id for ; Fri, 1 Apr 2005 13:52:38 -0500 Received: from emrelay.onebox.com by tank.electric.net with host-route (Exim 4.34) id 1DHRG1-00011o-47 for davecline at onebox.com; Fri, 01 Apr 2005 10:52:37 -0800 Received: by emcmailer; Fri, 01 Apr 2005 10:52:37 -0800 Received: from selene.latech.edu ([138.47.18.25] helo=LaTech.edu) by tank.electric.net with esmtp (Exim 4.34) id 1DHRFt-0000uO-66 for davecline at onebox.com; Fri, 01 Apr 2005 10:52:30 -0800 Received: from localhost (localhost [127.0.0.1]) by LaTech.edu (Postfix) with ESMTP id 1E9393090CC; Fri, 1 Apr 2005 12:52:22 -0600 (CST) Received: from LaTech.edu ([127.0.0.1]) by localhost (selene.latech.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08926-01-10; Fri, 1 Apr 2005 12:52:13 -0600 (CST) Received: from selene.LaTech.edu (localhost [127.0.0.1]) by LaTech.edu (Postfix) with ESMTP id 0BDCB308C2F; Fri, 1 Apr 2005 12:52:12 -0600 (CST) X-Original-To: javascript at localhost.LaTech.edu Delivered-To: javascript at localhost.LaTech.edu Received: from localhost (localhost [127.0.0.1]) by LaTech.edu (Postfix) with ESMTP id 9615D308A0A for ; Fri, 1 Apr 2005 12:52:09 -0600 (CST) Received: from LaTech.edu ([127.0.0.1]) by localhost (selene.latech.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 99184-01-11 for ; Fri, 1 Apr 2005 12:52:04 -0600 (CST) Received: from mail.doxdesk.com (mail.doxdesk.com [217.115.141.160]) by LaTech.edu (Postfix) with ESMTP id 69311308961 for ; Fri, 1 Apr 2005 12:52:04 -0600 (CST) Received: from [192.168.0.12] (blossom [61.213.122.58]) by mail.doxdesk.com (Postfix) with ESMTP id 0525613928 for ; Fri, 1 Apr 2005 18:36:58 +0000 (GMT) Message-ID: <424D9872.6040607 at doxdesk.com> Date: Sat, 02 Apr 2005 03:52:34 +0900 From: Andrew Clover User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "[JavaScript List]" Subject: Re: [Javascript] Re: scrollbars References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at latech.edu X-BeenThere: javascript at LaTech.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "[JavaScript List]" List-Id: "\[JavaScript List\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: javascript-bounces at LaTech.edu Errors-To: javascript-bounces at LaTech.edu X-Virus-Scanned: by amavisd-new at latech.edu X-Origin-IP: 138.47.18.25 X-SPAM-Status: NO, -0.2 / 4.0 DCC [0.0] BAYES [0%] X-Virus-Status: Scanned by VirusSMART (s) X-SPAM-Summary: DCC=0.0,REFERENCES=-0.2 Dash wrote: > ok, i modified the script to make it work. In the body tag of the page, > i've defined style="overflow:hidden;", so surely i dont need to check > for document.documentElement (if it's defined in the html file in the > body tag, it wouldn't shift anywhere else, would it?). document.documentElement actually refers to the root element - you would need to put the style in as well to have the same effect as the script version. The issue is that IE6/Standards makes the element represent the viewport, whilst IE5 and IE6/Quirks makes the element represent the viewport. The style has to be applied to the correct element (or both) to make the vertical scrollbar go away in IE/Win. Other browsers (correctly according to spec) don't have an element to represent the viewport; instead the viewport is 'above' the root element () and can't be touched with CSS, though since it only displays a scrollbar when there's too much vertical content to fit on-screen this isn't generally a problem. To actually get rid of 'necessary' scrollbars in all browsers is harder than just fixing IE/Win's unnecessary ones. You'd need to set a block to "overflow: hidden" *and* ensure that its height was the same as the viewport, which is trickier than it sounds: there is no reliable standards-compliant cross-browser-compatible way to give an element 'height: 100%' of the viewport. You can do it for many browsers (not IE/Win) in a standards-compliant way using 'position: fixed; height: 100%', and for many browsers (not IE/Mac) in a not-quite-standards-compliant way using 'position: absolute; height: 100%'. Any way you slice it you'll end up with browser hacks. Alternatively if you know the height of the content (eg. it's images or unwrapped fixed-size text) you could simply put the lot in a
with hidden overflow and a fixed-size height. > I want to be able to do this because i dont want the user to be able to > scroll down the page until an event occurs. Overflow is probably not a good mechanism for doing this. Some browsers would still let you access the hidden content (possibly accidentally) through keyboard control, for example. Not to mention very large screen resolutions. Any reason you couldn't just use a simple hidden
that gets displayed when the event occurs? -- Andrew Clover mailto:and at doxdesk.com http://www.doxdesk.com/ _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript From and-babble at doxdesk.com Fri Apr 1 13:10:01 2005 From: and-babble at doxdesk.com (Andrew Clover) Date: Sat, 02 Apr 2005 04:10:01 +0900 Subject: [Javascript] writing to iframe In-Reply-To: <6C71C1ACF8C70F4E96C54B28A790D8550299DBAC@STUDENT.mvcclabs.edu> References: <6C71C1ACF8C70F4E96C54B28A790D8550299DBAC@STUDENT.mvcclabs.edu> Message-ID: <424D9C89.5070407@doxdesk.com> John Huebner wrote: > Iframe_name.document.open; > Iframe_name.document.clear; > Iframe_name.documentl.write("content to be written"); > Iframe_name.document.close; open, clear and close are methods too, so if you want to call them (rather than just refer to them) you have to say open(), clear() and close(). You shouldn't need document.clear() anyway. Avoid writing just 'Iframe_name' - this requires that the browser copies references to named items as properties of the 'window' object (which acts like a global scope for a web page script). Most browsers *will* do this - not least because IE and Moz make 'window.frames' a synonym for 'window' - but it's best not to rely on it. You should also ensure that the iframe src points to a document on the same hostname, so that you're allowed to access its 'document' property. > I've even tried to call the iframe using > window.frames("Iframe_name").document Nearly. window.frames is supposed to be accessed like an Array (in some browsers it might actually be one), so use square instead of round brackets to access things from it. By the way in JavaScript, property and member access are the same thing, so: window.frames['Iframe_name'].document is the same as saying: window.frames.Iframe_name.document You only need the brackets if the name is not a valid identifier (ie. it has funny characters in) or if you want to use a variable to hold the property name you're going to access. -- Andrew Clover mailto:and at doxdesk.com http://www.doxdesk.com/ From jhuebner08 at student.mvcc.edu Fri Apr 1 15:00:37 2005 From: jhuebner08 at student.mvcc.edu (John Huebner) Date: Fri, 01 Apr 2005 16:00:37 -0500 Subject: [Javascript] writing to iframe In-Reply-To: <424D9C89.5070407@doxdesk.com> References: <6C71C1ACF8C70F4E96C54B28A790D8550299DBAC@STUDENT.mvcclabs.edu> <424D9C89.5070407@doxdesk.com> Message-ID: <424DB675.3070104@student.mvcc.edu> So you're saying it should be window.frames.iframe_name.document.open(); window.frames.iframe_name.document.write("content to write"); window.frames.iframe_name.document.close(); However, I don't understand why it the script needs to write to the file on the server. I am trying to write to the iframe within the current document. The iframe starts out empty, no src value at all. As I've said, It works in IE. IE seems to except it almost no matter how I write it. On the other hand, netscape does not. As I said. I can get netscape to write to the iframe the first time through but after that it fails. I'm afraid you've lost me on with some of what you said. I will try the above. Somehow I'm afraid that it is a problem with the Mozilla based browsers though. If I have the above wrong please let me know, As I said, I appreciate any input I can get on this. Andrew Clover wrote: > John Huebner wrote: > >> Iframe_name.document.open; >> Iframe_name.document.clear; >> Iframe_name.documentl.write("content to be written"); >> Iframe_name.document.close; > > > open, clear and close are methods too, so if you want to call them > (rather than just refer to them) you have to say open(), clear() and > close(). You shouldn't need document.clear() anyway. > > Avoid writing just 'Iframe_name' - this requires that the browser copies > references to named items as properties of the 'window' object (which > acts like a global scope for a web page script). Most browsers *will* do > this - not least because IE and Moz make 'window.frames' a synonym for > 'window' - but it's best not to rely on it. > > You should also ensure that the iframe src points to a document on the > same hostname, so that you're allowed to access its 'document' property. > >> I've even tried to call the iframe using > > >> window.frames("Iframe_name").document > > > Nearly. > > window.frames is supposed to be accessed like an Array (in some browsers > it might actually be one), so use square instead of round brackets to > access things from it. > > By the way in JavaScript, property and member access are the same thing, > so: > > window.frames['Iframe_name'].document > > is the same as saying: > > window.frames.Iframe_name.document > > You only need the brackets if the name is not a valid identifier (ie. it > has funny characters in) or if you want to use a variable to hold the > property name you're going to access. > From java.script at seacrets.com Fri Apr 1 19:01:40 2005 From: java.script at seacrets.com (Cutter) Date: Fri, 01 Apr 2005 20:01:40 -0500 Subject: [Javascript] writing to iframe In-Reply-To: <424DB675.3070104@student.mvcc.edu> References: <6C71C1ACF8C70F4E96C54B28A790D8550299DBAC@STUDENT.mvcclabs.edu> <424D9C89.5070407@doxdesk.com> <424DB675.3070104@student.mvcc.edu> Message-ID: <424DEEF4.80406@seacrets.com> John, Unfortunately, IE is pretty far from standards compliant. Makes it difficult when most users (not us codemonkey types) use IE. You can probably find better information on how to deal with this in the W3C documentation of the DOM IFrame Object: http://www.w3schools.com/htmldom/dom_obj_iframe.asp You will find a specific example of exactly what you are trying to do there under the heading "Change the source of frames". I just tried this in Firefox and IE and it worked fine, you can view the source of the page for better understanding. I used to almost exclusively code for IE. Since seeing "Mozilla" creep higher and higher in my various site logs over the past two years I've started to write cross compatible code. I've found (anybody can pipe in with a different opinion) that it is easier to write for Firefox, or other W3C standards compliant browser, first and then write the adjustments/hacks to deal with M$ being behind the eight ball. My $.02. Hope the link helps, Cutter John Huebner wrote: > So you're saying it should be > > window.frames.iframe_name.document.open(); > window.frames.iframe_name.document.write("content to write"); > window.frames.iframe_name.document.close(); > > However, I don't understand why it the script needs to write to the > file on the server. I am trying to write to the iframe within the > current document. The iframe starts out empty, no src value at all. > > As I've said, It works in IE. IE seems to except it almost no matter > how I write it. On the other hand, netscape does not. As I said. I can > get netscape to write to the iframe the first time through but after > that it fails. > > I'm afraid you've lost me on with some of what you said. > > I will try the above. Somehow I'm afraid that it is a problem with the > Mozilla based browsers though. > > If I have the above wrong please let me know, > > As I said, I appreciate any input I can get on this. > > Andrew Clover wrote: > >> John Huebner wrote: >> >>> Iframe_name.document.open; >>> Iframe_name.document.clear; >>> Iframe_name.documentl.write("content to be written"); >>> Iframe_name.document.close; >> >> >> >> open, clear and close are methods too, so if you want to call them >> (rather than just refer to them) you have to say open(), clear() and >> close(). You shouldn't need document.clear() anyway. >> >> Avoid writing just 'Iframe_name' - this requires that the browser >> copies references to named items as properties of the 'window' object >> (which acts like a global scope for a web page script). Most browsers >> *will* do this - not least because IE and Moz make 'window.frames' a >> synonym for 'window' - but it's best not to rely on it. >> >> You should also ensure that the iframe src points to a document on >> the same hostname, so that you're allowed to access its 'document' >> property. >> >>> I've even tried to call the iframe using >> >> >> >>> window.frames("Iframe_name").document >> >> >> >> Nearly. >> >> window.frames is supposed to be accessed like an Array (in some >> browsers it might actually be one), so use square instead of round >> brackets to access things from it. >> >> By the way in JavaScript, property and member access are the same >> thing, so: >> >> window.frames['Iframe_name'].document >> >> is the same as saying: >> >> window.frames.Iframe_name.document >> >> You only need the brackets if the name is not a valid identifier (ie. >> it has funny characters in) or if you want to use a variable to hold >> the property name you're going to access. >> > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From info at abyss.ws Sun Apr 3 04:57:04 2005 From: info at abyss.ws (Abyss) Date: Sun, 3 Apr 2005 19:57:04 +1000 Subject: [Javascript] CSS and Javascript Message-ID: <000a01c53833$7ebb5160$6401a8c0@hawkeye> Hi All Im trying to (with complete failur) to hide a span when the page loads but to display it when a certain drop down box menu is selected. JS code in head if (document.all) { document.all.soldOrderBlock.style.display='none'; } else { document.layers['soldOrderBlock'].style.display='none'; } and calling the JS fuction like this showHideSelection(); from the head I do not want to - I cannot - use the onload part of the body because of certain bad design specs..so can anyone see what I am doing wrong? it works with the onchange on the drop down box, just not when the page loads. can anyone suggest as to why? Thanks heaps... Abyss -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at novitskisoftware.com Sun Apr 3 07:52:27 2005 From: paul at novitskisoftware.com (Paul Novitski) Date: Sun, 03 Apr 2005 05:52:27 -0700 Subject: [Javascript] CSS and Javascript In-Reply-To: <000a01c53833$7ebb5160$6401a8c0@hawkeye> References: <000a01c53833$7ebb5160$6401a8c0@hawkeye> Message-ID: <6.2.0.14.2.20050403052655.0402ea80@spamarrest.com> At 01:57 AM 4/3/2005, Abyss wrote: >Im trying to (with complete failur) to hide a span when the page loads Abyss, Put this into your javascript file: indow.onload = showHideSelection; Then you don't have to put anything into your body tag. The main criticism of the window.onload technique is that you can do it only once; repeat calls overwrite rather than accumulate onload functions. One solution is to create a kind of onload function pool to which you add calls as needed: window.onload = function () { initMouseOvers(); initSpanBehavior(); } [Ref: ] Recently I came across a niftier solution (wish I could remember where!) which I think went like this: window.onload = function() { if (window.onload) { window.onload(); showHideSelection(); } else { showHideSelection(); } } This naturally concatenates onload functions and lets several external javascript functions start up on page-load without stepping on one another's toes. Paul PS: Not a good idea to post javascript questions to the CSS-D list. This question doesn't really pertain to CSS. From trojani2000 at hotmail.com Sun Apr 3 11:14:43 2005 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sun, 03 Apr 2005 18:14:43 +0200 Subject: [Javascript] CSS and Javascript In-Reply-To: <000a01c53833$7ebb5160$6401a8c0@hawkeye> Message-ID: I'm sure you are too bussy with js, that you are forgeting to use the static css to define the attributes of the SPAN or whatever. onload event, will allways fire the command only after the page is loaded completely or almost completely. So your span will first get displayed, taking its space and then get hidden and the page view will have to reflow, it makes you seasick. Define your span style to display nothing by default and remove the onLoad completely. You will not need it anymore. Keep the function you use to show/hide your SPAN with user actions and you're a Go... >From: "Abyss" >Reply-To: "[JavaScript List]" >To: "[JavaScript List]" >CC: css-d at lists.css-discuss.org >Subject: [Javascript] CSS and Javascript >Date: Sun, 3 Apr 2005 19:57:04 +1000 > >Hi All > >Im trying to (with complete failur) to hide a span when the page loads > >but to display it when a certain drop down box menu is selected. > > > > >JS code in head > >if (document.all) > { > document.all.soldOrderBlock.style.display='none'; > } > else > { > document.layers['soldOrderBlock'].style.display='none'; > } > >and calling the JS fuction like this > >showHideSelection(); > >from the head > >I do not want to - I cannot - use the onload part of the body because of >certain bad design specs..so can anyone see what I am doing wrong? > >it works with the onchange on the drop down box, just not when the page >loads. > >can anyone suggest as to why? > >Thanks heaps... >Abyss >_______________________________________________ >Javascript mailing list >Javascript at LaTech.edu >https://lists.LaTech.edu/mailman/listinfo/javascript _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ From borchers at tridem.de Mon Apr 4 02:50:55 2005 From: borchers at tridem.de (Michael Borchers) Date: Mon, 4 Apr 2005 09:50:55 +0200 Subject: AW: AW: [Javascript] checkboxes in array Message-ID: <26FAB31EFF50034782DFE474AB44FE3E35448D@NT-SF-Exchange> > How about this:? > > > > > onFocus="checkIt('typ_1');" /> > > > > > onFocus="checkIt('typ_2');" /> > > [etc.] > > > > > Note: the use of the