From loic_sephiroth at yahoo.es Fri Sep 1 03:37:17 2006 From: loic_sephiroth at yahoo.es (=?ISO-8859-1?Q?Lo=EFc?=) Date: Fri, 01 Sep 2006 10:37:17 +0200 Subject: [Javascript] Knowing wich function called another function within the code of the latter. Message-ID: <44F7F13D.20402@yahoo.es> [quote="Matt Warden"] The only thing I know of is arguments.caller, which was deprecated in JS1.3. [/quote] Thank you for your answer, Matt. I've searched the topic, but it is indeed a deprecated method, and therefore i can't use it. I also realized that the arguments.caller would return the body element, since the include functions are called as a global method (recall the Main.js file) to a Class file, so it wouldn't have served me as i expected. Well, i'll try a different approach to solve the problem. The only way i can think of now, is to pass the qualified name of the Class to the include method, but i find it an ugly thing to write and read. ______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y m?viles desde 1 c?ntimo por minuto. http://es.voice.yahoo.com From lists at dwsasia.com Sun Sep 3 21:13:05 2006 From: lists at dwsasia.com (Peter Lauri) Date: Mon, 4 Sep 2006 09:13:05 +0700 Subject: [Javascript] Odd behaviour? Message-ID: <20060904021333.DBA4D12003@smtp2.LaTech.edu> Hi, I make an AJAX request and on the server side this is generated (I push it into a database to detect problem before outputting it in the script that is requested with get):

Close

Nameasdf
Description
Assigned to
Created byPeter Lauri(Farang)
Due date
Start date
PriorityNormal
Creation dateSun, 03 Sep 2006 23:09:44 +0700
But it stops after the after the Description. The content of the where it breaks comes from a database field. If the field is empty this happens, if it is not empty everything works fine. I am using innerHTML property to insert this into the web page. When I make this request on a "static" way it works fine all cases, but with AJAX it does not work. This makes me confused :) /Peter From david at dorward.me.uk Mon Sep 4 04:06:46 2006 From: david at dorward.me.uk (David Dorward) Date: Mon, 4 Sep 2006 10:06:46 +0100 Subject: [Javascript] Odd behaviour? In-Reply-To: <20060904021333.DBA4D12003@smtp2.LaTech.edu> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> Message-ID: <20060904090646.GA26749@us-lot.org> On Mon, Sep 04, 2006 at 09:13:05AM +0700, Peter Lauri wrote: > I make an AJAX request and on the server side this is generated (I push it > into a database to detect problem before outputting it in the script that is > requested with get): > > >

Invalid.

elements may not be children of

elements, and this is an area where browsers act differently in their attempts to compensate for the error. > Close

http://www.jibbering.com/faq/#FAQ4_24 and you have a rogue quote there too. -- David Dorward http://dorward.me.uk From riegel at clearimageonline.com Wed Sep 6 07:56:00 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Wed, 6 Sep 2006 08:56:00 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <20060904090646.GA26749@us-lot.org> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> Message-ID: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Hello, I would like to swap out an image in an application I am writing. Basically I want to swap two image tags, the trick is I want to swap their ID and NAME tags also. For example, I have the following HTML... ... ... ... that I would like to use javacscript to make into... ... ... ... The important thing Is I would like to swap all of the attributes out. i.e. width,height,id,name,src Thanks, Terry Riegel From mdougherty at pbp.com Wed Sep 6 08:11:00 2006 From: mdougherty at pbp.com (Mike Dougherty) Date: Wed, 06 Sep 2006 09:11:00 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: wouldn't it be easier just to swap their src attributes? On Wed, 6 Sep 2006 08:56:00 -0400 Terry Riegel wrote: > Hello, > > I would like to swap out an image in an application I am writing. Basically I want to swap two >image tags, the trick is I want to swap their ID and NAME tags also. > The important thing Is I would like to swap all of the attributes out. i.e. >width,height,id,name,src From riegel at clearimageonline.com Wed Sep 6 08:34:45 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Wed, 6 Sep 2006 09:34:45 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> Sure, but then I would have an ID that represented the wrong image. And any subsequent manipulations with that image would be for the wrong ID. Swapping the src tag makes it look like it has swapped, but further javascript queries are going to be referencing the wrong ID, height, width, etc... Terry On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: > wouldn't it be easier just to swap their src attributes? > > On Wed, 6 Sep 2006 08:56:00 -0400 > Terry Riegel wrote: >> Hello, >> I would like to swap out an image in an application I am writing. >> Basically I want to swap two image tags, the trick is I want to >> swap their ID and NAME tags also. >> The important thing Is I would like to swap all of the attributes >> out. i.e. width,height,id,name,src > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From matt.ludbrook at emicassociates.co.uk Wed Sep 6 08:46:34 2006 From: matt.ludbrook at emicassociates.co.uk (Matt Ludbrook) Date: Wed, 6 Sep 2006 14:46:34 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> Message-ID: <002f01c6d1ba$df6f3f90$0100a8c0@emicmatt> But you said you wanted to swap the IDs. Your initial description makes it sound like you want to swap everything except the src. In that case swapping the src would be the easier way of solving your prob. Matt -----Original Message----- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of Terry Riegel Sent: 06 September 2006 14:35 To: [JavaScript List] Subject: Re: [Javascript] Changing an Objects ID and Name Sure, but then I would have an ID that represented the wrong image. And any subsequent manipulations with that image would be for the wrong ID. Swapping the src tag makes it look like it has swapped, but further javascript queries are going to be referencing the wrong ID, height, width, etc... Terry On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: > wouldn't it be easier just to swap their src attributes? > > On Wed, 6 Sep 2006 08:56:00 -0400 > Terry Riegel wrote: >> Hello, >> I would like to swap out an image in an application I am writing. >> Basically I want to swap two image tags, the trick is I want to swap >> their ID and NAME tags also. >> The important thing Is I would like to swap all of the attributes >> out. i.e. width,height,id,name,src > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: 05/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: 05/09/2006 From rer at datacompusa.com Wed Sep 6 08:52:50 2006 From: rer at datacompusa.com (Roger Roelofs) Date: Wed, 6 Sep 2006 09:52:50 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> Message-ID: <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> Terry, Without seeing the page, I can't tell if it would work for sure, but, couldn't you just set the className and use css to get the display you want? On Sep 6, 2006, at 9:34 AM, Terry Riegel wrote: > Sure, but then I would have an ID that represented the wrong image. > And any subsequent manipulations with that image would be for the > wrong ID. > > Swapping the src tag makes it look like it has swapped, but further > javascript queries are going to be referencing the wrong ID, > height, width, etc... > > Terry > > > On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: > >> wouldn't it be easier just to swap their src attributes? >> >> On Wed, 6 Sep 2006 08:56:00 -0400 >> Terry Riegel wrote: >>> Hello, >>> I would like to swap out an image in an application I am >>> writing. Basically I want to swap two image tags, the trick is I >>> want to swap their ID and NAME tags also. >>> The important thing Is I would like to swap all of the >>> attributes out. i.e. width,height,id,name,src Roger -- Roger Roelofs web www.datacompusa.com Datacomp Appraisal Services Email rer at datacompusa.com 3215 Eaglecrest Drive, NE Grand Rapids, MI 49525-4593 From flavio at economisa.com.br Wed Sep 6 08:56:15 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Wed, 06 Sep 2006 10:56:15 -0300 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> Message-ID: <44FED37F.5080603@economisa.com.br> Havent tought a lot, but you could store all images informations in a array, then you make a simple function to swap them, taking care not to let two images with the same ID. Terry Riegel escreveu: > Sure, but then I would have an ID that represented the wrong image. > And any subsequent manipulations with that image would be for the > wrong ID. > > Swapping the src tag makes it look like it has swapped, but further > javascript queries are going to be referencing the wrong ID, height, > width, etc... > > Terry > > > On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: > >> wouldn't it be easier just to swap their src attributes? >> >> On Wed, 6 Sep 2006 08:56:00 -0400 >> Terry Riegel wrote: >> >>> Hello, >>> I would like to swap out an image in an application I am writing. >>> Basically I want to swap two image tags, the trick is I want to >>> swap their ID and NAME tags also. >>> The important thing Is I would like to swap all of the attributes >>> out. i.e. width,height,id,name,src >> >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript > > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -- Flavio Gomes flavio at economisa.com.br From jonathan.buchanan at gmail.com Wed Sep 6 09:20:27 2006 From: jonathan.buchanan at gmail.com (Jonathan Buchanan) Date: Wed, 6 Sep 2006 15:20:27 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: On 9/6/06, Terry Riegel wrote: > Hello, > > I would like to swap out an image in an application I am writing. > Basically I want to swap two image tags, the trick is I want to swap > their ID and NAME tags also. > > For example, I have the following HTML... > > > ... > > ... > > ... > > > that I would like to use javacscript to make into... > > ... > > ... > > ... > > The important thing Is I would like to swap all of the attributes > out. i.e. width,height,id,name,src > > Thanks, > > Terry Riegel If you want to swap element locations (which is what you're really doing, if I've understood the question correctly), do it directly using the DOM instead of fiddling about with element attributes: function swapNodes(n1, n2) { var placeHolder = document.createElement("span"); n1.parentNode.replaceChild(placeHolder, n1); n2.parentNode.replaceChild(n1, n2); placeHolder.parentNode.replaceChild(n2, placeHolder); } swapNodes(document.getElementById("abc"), document.getElementById("def")); Regards, Jonathan. From tedd at sperling.com Wed Sep 6 09:32:20 2006 From: tedd at sperling.com (tedd) Date: Wed, 6 Sep 2006 10:32:20 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: At 8:56 AM -0400 9/6/06, Terry Riegel wrote: >I would like to swap out an image in an application I am writing. >Basically I want to swap two image tags, the trick is I want to swap >their ID and NAME tags also. > >For example, I have the following HTML... > ... > > > ... >that I would like to use javacscript to make into... > ... > > > ... > >The important thing Is I would like to swap all of the attributes >out. i.e. width,height,id,name,src Terry: I don't know about objects, but you can do what you described above several ways: 1. With ajax you can change the html between divs. 2. With css you can absolutely position both and then swap with a style switcher. 3. With css you can use the visibility attribute showing both combinations and then change visibility/hidden with a style switcher. 4. Or, you can do it like this via js: http://xn--ovg.com/a1.php hth's tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From riegel at clearimageonline.com Wed Sep 6 09:41:28 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Wed, 6 Sep 2006 10:41:28 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <002f01c6d1ba$df6f3f90$0100a8c0@emicmatt> References: <002f01c6d1ba$df6f3f90$0100a8c0@emicmatt> Message-ID: <41669544-0CF4-4BA4-8AA6-B9339ABC071E@clearimageonline.com> No, I want to swap everything including the src. Sorry if that wasn't clear. Terry On Sep 6, 2006, at 9:46 AM, Matt Ludbrook wrote: > But you said you wanted to swap the IDs. Your initial description > makes it > sound like you want to swap everything except the src. In that case > swapping > the src would be the easier way of solving your prob. > > > Matt > > > > > -----Original Message----- > From: javascript-bounces at LaTech.edu [mailto:javascript- > bounces at LaTech.edu] > On Behalf Of Terry Riegel > Sent: 06 September 2006 14:35 > To: [JavaScript List] > Subject: Re: [Javascript] Changing an Objects ID and Name > > Sure, but then I would have an ID that represented the wrong image. > And any subsequent manipulations with that image would be for the > wrong ID. > > Swapping the src tag makes it look like it has swapped, but further > javascript queries are going to be referencing the wrong ID, > height, width, > etc... > > Terry > > > On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: > >> wouldn't it be easier just to swap their src attributes? >> >> On Wed, 6 Sep 2006 08:56:00 -0400 >> Terry Riegel wrote: >>> Hello, >>> I would like to swap out an image in an application I am writing. >>> Basically I want to swap two image tags, the trick is I want to swap >>> their ID and NAME tags also. >>> The important thing Is I would like to swap all of the attributes >>> out. i.e. width,height,id,name,src >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: > 05/09/2006 > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: > 05/09/2006 > > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From riegel at clearimageonline.com Wed Sep 6 09:44:44 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Wed, 6 Sep 2006 10:44:44 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> Message-ID: <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> Roger, Jonathan, All, An example page is at ... http://clearimageonline.com/pages/start/projects/draganddrop/album.html I am trying to build the part that will allow the user to swap images without a page reload. There may be a better way to do it that I am not thinking of. As far as swapping the drag and drop images I can do that with Walter Zorn's supplied methods, I need to change the images in the original HTML. I will try Jonathan's suggestion as it sounds the most promising. Thanks, Terry On Sep 6, 2006, at 9:52 AM, Roger Roelofs wrote: > Terry, > > Without seeing the page, I can't tell if it would work for sure, > but, couldn't you just set the className and use css to get the > display you want? > > On Sep 6, 2006, at 9:34 AM, Terry Riegel wrote: > >> Sure, but then I would have an ID that represented the wrong >> image. And any subsequent manipulations with that image would be >> for the wrong ID. >> >> Swapping the src tag makes it look like it has swapped, but >> further javascript queries are going to be referencing the wrong >> ID, height, width, etc... >> >> Terry >> >> >> On Sep 6, 2006, at 9:11 AM, Mike Dougherty wrote: >> >>> wouldn't it be easier just to swap their src attributes? >>> >>> On Wed, 6 Sep 2006 08:56:00 -0400 >>> Terry Riegel wrote: >>>> Hello, >>>> I would like to swap out an image in an application I am >>>> writing. Basically I want to swap two image tags, the trick is >>>> I want to swap their ID and NAME tags also. >>>> The important thing Is I would like to swap all of the >>>> attributes out. i.e. width,height,id,name,src > > Roger On Sep 6, 2006, at 10:20 AM, Jonathan Buchanan wrote: > If you want to swap element locations (which is what you're really > doing, if I've understood the question correctly), do it directly > using the DOM instead of fiddling about with element attributes: > > function swapNodes(n1, n2) > { > var placeHolder = document.createElement("span"); > n1.parentNode.replaceChild(placeHolder, n1); > n2.parentNode.replaceChild(n1, n2); > placeHolder.parentNode.replaceChild(n2, placeHolder); > } > > swapNodes(document.getElementById("abc"), document.getElementById > ("def")); > > Regards, > Jonathan. From paul at juniperwebcraft.com Wed Sep 6 10:21:48 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Wed, 06 Sep 2006 08:21:48 -0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> At 9/6/2006 05:56 AM, Terry Riegel wrote: >I would like to swap out an image in an application I am writing. >Basically I want to swap two image tags, the trick is I want to swap >their ID and NAME tags also. ... >The important thing Is I would like to swap all of the attributes >out. i.e. width,height,id,name,src Terry, What hurdles have you encountered doing exactly what you're wanting to do? Like others on this list, I'm curious to know if there are other solutions to whatever your problem might be, but I don't see why you can't simply do what you want. Attributes including id are read/write. Swapping them is not difficult. Once you've pointed to an object, e.g. var oObj1 = document.getElementById(sId1); you can change all of its attributes, including id. Some attributes such as id have named nodes in the DOM: sSwapAttribute = oObj1.id; oObj1.id = oObj2.id; oObj2.id = sSwapAttribute; http://developer.mozilla.org/en/docs/DOM:element.id Others need to be access using getAttribute() & setAttribute(): sSwapAttribute = oObj1.getAttribute("foo"); oObj1.setAttribute("foo", oObj2.getAttribute("foo")); oObj2.setAttribute("foo", sSwapAttribute); http://developer.mozilla.org/en/docs/DOM:element.getAttribute http://developer.mozilla.org/en/docs/DOM:element.setAttribute You can also make good use of attributes() which returns an array of all attributes of the specified element. http://developer.mozilla.org/en/docs/DOM:element.attributes However, this seems like a lot of logic to accomplish a simpler task, to swap the actual nodes in the DOM, as Jonathan points out. Philosophically, one wonders: if you swap all the attributes of two elements, what's left to distinguish them? Their placement in the HTML markup. Their placement is significant because it determines their sequence in the markup structure and because it can affect their visual placement on the page. I would say that in the majority of cases one can swap two elements in the visual layout using CSS. If this presentational swapping is your goal, there are alternative methods you might consider (such as simply swapping their classNames). Regards, Paul From blmatthews at gmail.com Wed Sep 6 11:05:07 2006 From: blmatthews at gmail.com (Brian L. Matthews) Date: Wed, 6 Sep 2006 09:05:07 -0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: >1. With ajax you can change the html between divs. No. Ajax is the client communicating with a server, usually using XMLHttpRequest. While lots of applications manipulate the DOM in the client based upon the result of the request, the two are completely independent. A page can make XMLHttpRequests and then not change the page in any way, and JavaScript (or other client side scripting languages) can modify the page using DOM methods without talking to a server at all. >4. Or, you can do it like this via js: > >http://xn--ovg.com/a1.php That page manipulates the DOM using innerHTML (at least the show part, the don't show part just reloads the page from the server.) It would also be better done by manipulating the visibility or display style attributes. >I need to change the images in the original HTML. Does this mean if the user reloads the page they should see the images where they moved them to? Then you'll need to have the page tell the server what images have swapped, as the script in the client can't make permanent changes to the page. For actually swapping the images on the client side, using DOM methods like someone posted earlier to swap the img nodes is probably the way to go. Brian From john at jwarner.com Wed Sep 6 13:34:35 2006 From: john at jwarner.com (John Warner) Date: Wed, 6 Sep 2006 14:34:35 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> Message-ID: <069901c6d1e3$1ae1e0f0$6b01a8c0@earth> Paul, let me show my ignorance, but can you 'swap' id attributes in the fashion below? What I mean is you would seem to have for a moment two elements with the same ID. The parser 'should' get rather upset with this situation. Of course I know there is something I'm not seeing here. John Warner > -----Original Message----- > From: javascript-bounces at LaTech.edu > [mailto:javascript-bounces at LaTech.edu] On Behalf Of Paul Novitski > Sent: Wednesday, September 06, 2006 11:22 AM > To: javascript at LaTech.edu > Subject: Re: [Javascript] Changing an Objects ID and Name > > > At 9/6/2006 05:56 AM, Terry Riegel wrote: > >I would like to swap out an image in an application I am writing. > >Basically I want to swap two image tags, the trick is I want to swap > >their ID and NAME tags also. > ... > >The important thing Is I would like to swap all of the > attributes out. > >i.e. width,height,id,name,src > > > Terry, > > What hurdles have you encountered doing exactly what you're wanting > to do? Like others on this list, I'm curious to know if > there are other solutions to whatever your problem might be, > but I don't see > why you can't simply do what you want. Attributes including id are > read/write. Swapping them is not difficult. Once you've pointed to > an object, e.g. > > var oObj1 = document.getElementById(sId1); > > you can change all of its attributes, including id. > > Some attributes such as id have named nodes in the DOM: > > sSwapAttribute = oObj1.id; > oObj1.id = oObj2.id; > oObj2.id = sSwapAttribute; > http://developer.mozilla.org/en/docs/DOM:element.id Others need to be access using getAttribute() & setAttribute(): sSwapAttribute = oObj1.getAttribute("foo"); oObj1.setAttribute("foo", oObj2.getAttribute("foo")); oObj2.setAttribute("foo", sSwapAttribute); http://developer.mozilla.org/en/docs/DOM:element.getAttribute http://developer.mozilla.org/en/docs/DOM:element.setAttribute You can also make good use of attributes() which returns an array of all attributes of the specified element. http://developer.mozilla.org/en/docs/DOM:element.attributes However, this seems like a lot of logic to accomplish a simpler task, to swap the actual nodes in the DOM, as Jonathan points out. Philosophically, one wonders: if you swap all the attributes of two elements, what's left to distinguish them? Their placement in the HTML markup. Their placement is significant because it determines their sequence in the markup structure and because it can affect their visual placement on the page. I would say that in the majority of cases one can swap two elements in the visual layout using CSS. If this presentational swapping is your goal, there are alternative methods you might consider (such as simply swapping their classNames). Regards, Paul From paul at juniperwebcraft.com Wed Sep 6 16:34:00 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Wed, 06 Sep 2006 14:34:00 -0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <069901c6d1e3$1ae1e0f0$6b01a8c0@earth> References: <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <069901c6d1e3$1ae1e0f0$6b01a8c0@earth> Message-ID: <7.0.1.0.2.20060906133001.05f409e8@juniperwebcraft.com> At 9/6/2006 11:34 AM, John Warner wrote: >Paul, let me show my ignorance, but can you 'swap' id attributes in the >fashion below? What I mean is you would seem to have for a moment two >elements with the same ID. The parser 'should' get rather upset with >this situation. Of course I know there is something I'm not seeing here. Good call. Although I've seen the DOM tolerate elements with duplicate ids, you're right that we shouldn't rely on it in deference to future engines that are more strict. Perhaps a better way would be: sId1 = oObj1.id; sId2 = oObj2.id; oObj1.id = ''; oObj2.id = sId1; oObj1.id = sId2; Paul From tedd at sperling.com Wed Sep 6 17:10:52 2006 From: tedd at sperling.com (tedd) Date: Wed, 6 Sep 2006 18:10:52 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: At 9:05 AM -0700 9/6/06, Brian L. Matthews wrote: >>1. With ajax you can change the html between divs. > >No. Ajax is the client communicating with a server, usually using >XMLHttpRequest. While lots of applications manipulate the DOM in the >client based upon the result of the request, the two are completely >independent. A page can make XMLHttpRequests and then not change the >page in any way, and JavaScript (or other client side scripting >languages) can modify the page using DOM methods without talking to >a server at all. Well maybe I just don't know any better. I used ajax to send a XMLHttpRequest that changes the html without reloading the entire page. The poster said he wanted to swap html from this: to this: So, using *his* code, I did the following with ajax: http://xn--ovg.com/ajax2 Does this not solve the problem? If so, what am I not understanding? Thanks. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Wed Sep 6 17:22:49 2006 From: tedd at sperling.com (tedd) Date: Wed, 6 Sep 2006 18:22:49 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: At 9:05 AM -0700 9/6/06, Brian L. Matthews wrote: > >>4. Or, you can do it like this via js: >> >>http://xn--ovg.com/a1.php > >That page manipulates the DOM using innerHTML (at least the show >part, the don't show part just reloads the page from the server.) The "don't show part" doesn't do anything of the sort -- it is simply a wrapper for the code shown. The code shown ("the show part") does the work -- that's the reason why it's shown. >It would also be better done by manipulating the visibility or >display style attributes. Does this -- 3. With css you can use the visibility attribute showing both combinations and then change visibility/hidden with a style switcher. -- not say that? Again, what is it that I'm not getting here? Is it communication with the server? Must the solution not contact the server, is that it? tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From scott at randomchaos.com Wed Sep 6 17:42:12 2006 From: scott at randomchaos.com (Scott Reynen) Date: Wed, 6 Sep 2006 17:42:12 -0500 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: <7A41BBF4-BD99-4EAA-91F9-B06A552823C0@randomchaos.com> On Sep 6, 2006, at 5:10 PM, tedd wrote: > At 9:05 AM -0700 9/6/06, Brian L. Matthews wrote: >>> 1. With ajax you can change the html between divs. >> >> No. Ajax is the client communicating with a server, usually using >> XMLHttpRequest. While lots of applications manipulate the DOM in >> the client based upon the result of the request, the two are >> completely independent. A page can make XMLHttpRequests and then >> not change the page in any way, and JavaScript (or other client >> side scripting languages) can modify the page using DOM methods >> without talking to a server at all. > > Well maybe I just don't know any better. > > I used ajax to send a XMLHttpRequest that changes the html without > reloading the entire page. No, you didn't. You used AJAX/XMLHttpRequest to fetch content from the server. You used DOM manipulation to change HTML. That you used both in the same script does not in any way contradict what Brian said: the two are completely independent. AJAX is not the same as DOM manipulation. On Sep 6, 2006, at 5:22 PM, tedd wrote: > Again, what is it that I'm not getting here? Is it communication > with the server? Must the solution not contact the server, is that it? Why would you use AJAX here? It doesn't appear to solve the problem at hand. If you're just using AJAX because you want to use AJAX, that's fine, but presenting it as a solution to a problem it doesn't actually solve is likely to confuse people. The problem of swapping images is solved with DOM manipulation. Anything you add on top of that is solving a different problem -- assuming it solves a problem at all. Peace, Scott From riegel at clearimageonline.com Wed Sep 6 23:21:38 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 00:21:38 -0400 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> Message-ID: <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> Paul, if you have a look at my example page I can explain from that. http://clearimageonline.com/pages/start/projects/draganddrop/album.html On this page you can drag around images and if they are not on a drop zone they will snap back, if they are on a drop zone they will zoom down to it. Also if you click outside an image it will deselect all images. What I am trying to accomplish is to allow a user (when dragging 1 image) to drop it and it will get inserted into the spot and all the other images will ripple to give it room. For every image on the page there is the original image and a cloned image (via Walter Zorn's drag and drop script). I can swap the cloned images using the methods provided by Walter Zorn. I have implemented the function presented by Jonathan Buckman (Thanks Jonathan) to simply swap out the objects. So I am able to swap images around. I have the image swap working, I expect to have the final drop/ripple working later tomorrow. I was able to get a lot working today. I modified it slightly to include the type of node being swapped. function swapNodes(n1, n2, k) { var placeHolder = document.createElement(k); n1.parentNode.replaceChild(placeHolder, n1); n2.parentNode.replaceChild(n1, n2); placeHolder.parentNode.replaceChild(n2, placeHolder); } Is there some type of cleanup needed to remove the temporary node (placeHolder)? Or is it local to the function and gets removed automatically? On Sep 6, 2006, at 11:21 AM, Paul Novitski wrote: > At 9/6/2006 05:56 AM, Terry Riegel wrote: >> I would like to swap out an image in an application I am writing. >> Basically I want to swap two image tags, the trick is I want to swap >> their ID and NAME tags also. > ... >> The important thing Is I would like to swap all of the attributes >> out. i.e. width,height,id,name,src > > > Terry, > > What hurdles have you encountered doing exactly what you're wanting > to do? Like others on this list, I'm curious to know if there are > other solutions to whatever your problem might be, but I don't see > why you can't simply do what you want. Attributes including id are > read/write. Swapping them is not difficult. Once you've pointed > to an object, e.g. > > var oObj1 = document.getElementById(sId1); > > you can change all of its attributes, including id. > > Some attributes such as id have named nodes in the DOM: > > sSwapAttribute = oObj1.id; > oObj1.id = oObj2.id; > oObj2.id = sSwapAttribute; > > http://developer.mozilla.org/en/docs/DOM:element.id > > Others need to be access using getAttribute() & setAttribute(): > > sSwapAttribute = oObj1.getAttribute("foo"); > oObj1.setAttribute("foo", oObj2.getAttribute("foo")); > oObj2.setAttribute("foo", sSwapAttribute); > > http://developer.mozilla.org/en/docs/DOM:element.getAttribute > http://developer.mozilla.org/en/docs/DOM:element.setAttribute > > You can also make good use of attributes() which returns an array > of all attributes of the specified element. > http://developer.mozilla.org/en/docs/DOM:element.attributes > > However, this seems like a lot of logic to accomplish a simpler > task, to swap the actual nodes in the DOM, as Jonathan points out. > > Philosophically, one wonders: if you swap all the attributes of two > elements, what's left to distinguish them? Their placement in the > HTML markup. Their placement is significant because it determines > their sequence in the markup structure and because it can affect > their visual placement on the page. I would say that in the > majority of cases one can swap two elements in the visual layout > using CSS. If this presentational swapping is your goal, there are > alternative methods you might consider (such as simply swapping > their classNames). > > Regards, > Paul > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From paul at juniperwebcraft.com Thu Sep 7 00:06:31 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Wed, 06 Sep 2006 22:06:31 -0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> Message-ID: <7.0.1.0.2.20060906215557.04458238@juniperwebcraft.com> At 9/6/2006 09:21 PM, Terry Riegel wrote: >http://clearimageonline.com/pages/start/projects/draganddrop/album.html ... >function swapNodes(n1, n2, k) >{ > var placeHolder = document.createElement(k); > n1.parentNode.replaceChild(placeHolder, n1); > n2.parentNode.replaceChild(n1, n2); > placeHolder.parentNode.replaceChild(n2, placeHolder); >} > >Is there some type of cleanup needed to remove the temporary node >(placeHolder)? Or is it local to the function and gets removed >automatically? Since you're creating the placeholder element in the document, I'm sure it's effectively global and will persist beyond the local function. I'd remove it just to be safe. It might take a huge amount of playing around to challenge local memory, but it seems more elegant to clean up after each iteration. By the way, nice user interface, Terry! Good start! I'll look forward to seeing your application when it's finished. I have just two suggestions that might already be on your to-do list: first that when dragging multiple images you show them all and not just the one where dragging was begun, and second that you represent the albums graphically, filling them with micro-thumbnails as pictures are dragged into them. It wasn't immediately clear to me where to drag the pictures, and it would be cool if this kind of GUI could be intuitively obvious. Regards, Paul From jonathan.buchanan at gmail.com Thu Sep 7 01:07:52 2006 From: jonathan.buchanan at gmail.com (Jonathan Buchanan) Date: Thu, 7 Sep 2006 07:07:52 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> Message-ID: On 9/7/06, Terry Riegel wrote: > > I modified it slightly to include the type of node being swapped. > > function swapNodes(n1, n2, k) > { > var placeHolder = document.createElement(k); > n1.parentNode.replaceChild(placeHolder, n1); > n2.parentNode.replaceChild(n1, n2); > placeHolder.parentNode.replaceChild(n2, placeHolder); > } > > Is there some type of cleanup needed to remove the temporary node > (placeHolder)? Or is it local to the function and gets removed > automatically? As placeHolder is declared using "var", it's local to the function. When the function returns, placeHolder is not attached to the document any more and there are no other references to it hanging around, so it should get removed automatically. FWIW, the type of element used for the placeHolder doesn't really matter. Jonathan. From lists at dwsasia.com Thu Sep 7 02:58:00 2006 From: lists at dwsasia.com (Peter Lauri) Date: Thu, 7 Sep 2006 14:58:00 +0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: Message-ID: <20060907075829.C3AC3132F1@smtp2.LaTech.edu> I thought it was the opposite so that something declared as var will be "global". For example: var thisVariable = 50; thisNoVariable = 5; trythis(); trythisno(); function trythis() { alert(thisVariable); } function trythisno() { alert(thisNoVariable); } I have not tested this, but I do believe there will be an error in the function trythisno(). /Peter -----Original Message----- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of Jonathan Buchanan Sent: Thursday, September 07, 2006 1:08 PM To: [JavaScript List] Subject: Re: [Javascript] Changing an Objects ID and Name On 9/7/06, Terry Riegel wrote: > > I modified it slightly to include the type of node being swapped. > > function swapNodes(n1, n2, k) > { > var placeHolder = document.createElement(k); > n1.parentNode.replaceChild(placeHolder, n1); > n2.parentNode.replaceChild(n1, n2); > placeHolder.parentNode.replaceChild(n2, placeHolder); > } > > Is there some type of cleanup needed to remove the temporary node > (placeHolder)? Or is it local to the function and gets removed > automatically? As placeHolder is declared using "var", it's local to the function. When the function returns, placeHolder is not attached to the document any more and there are no other references to it hanging around, so it should get removed automatically. FWIW, the type of element used for the placeHolder doesn't really matter. Jonathan. _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript From jonathan.buchanan at gmail.com Thu Sep 7 04:16:26 2006 From: jonathan.buchanan at gmail.com (Jonathan Buchanan) Date: Thu, 7 Sep 2006 10:16:26 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <20060907075829.C3AC3132F1@smtp2.LaTech.edu> References: <20060907075829.C3AC3132F1@smtp2.LaTech.edu> Message-ID: > I thought it was the opposite so that something declared as var will be > "global". For example: > > var thisVariable = 50; > thisNoVariable = 5; > > trythis(); > > trythisno(); > > function trythis() { > alert(thisVariable); > } > > function trythisno() { > alert(thisNoVariable); > } > > I have not tested this, but I do believe there will be an error in the > function trythisno(). > > /Peter Have a look at the documentation for the var operator: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Statements:var In your example, you've created two variables in the global scope, so both functions will work. As you can read in the documentation, it doesn't matter whether you use "var" or not when declaring functions in the global scope - you're already in the global scope, so by using the var operator you're just explicitly saying "I belong to the current scope, which is the global scope" (as with thisVariable) rather than saying "I belong to the default scope, which is the global scope" (as with thisNoVariable). What we're really interested in is the effect var has in a function. If you don't use the var operator, any variables you declare in a function get the default scope, which is the global scope. This is why it's important to use var to declare local variables in functions. function testScoping1() { cheese = 5; } testScoping1(); alert(typeof(cheese)); // Produces "number" - the cheese variable is now in the global scope! function testScoping2() { var toast = 10; } testScoping2(); alert(typeof(toast)); // Produces "undefined" - the toast variable was local to the function during its execution Jonathan. From paul at juniperwebcraft.com Thu Sep 7 05:33:35 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Thu, 07 Sep 2006 03:33:35 -0700 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> Message-ID: <7.0.1.0.2.20060907032250.022014b0@juniperwebcraft.com> At 9/6/2006 11:07 PM, Jonathan Buchanan wrote: >On 9/7/06, Terry Riegel wrote: >> >>I modified it slightly to include the type of node being swapped. >> >>function swapNodes(n1, n2, k) >>{ >> var placeHolder = document.createElement(k); >> n1.parentNode.replaceChild(placeHolder, n1); >> n2.parentNode.replaceChild(n1, n2); >> placeHolder.parentNode.replaceChild(n2, placeHolder); >>} >> >>Is there some type of cleanup needed to remove the temporary node >>(placeHolder)? Or is it local to the function and gets removed >>automatically? > >As placeHolder is declared using "var", it's local to the function. >When the function returns, placeHolder is not attached to the document >any more and there are no other references to it hanging around, so it >should get removed automatically. Jonathan, I suspect you're wrong on this point. While I agree that the variable 'placeHolder' is local to the function 'swapNodes()' and will be cleared when the function terminates, surely when you invoke the DOM method createElement() you're creating a new element IN THE DOM which has got to be about as global as you can get in a script running in the context of the Document Object Model. Am I wrong about this? Does the createElement() method return a node object that isn't actually part of the DOM and doesn't persist when the calling function returns? Regards, Paul From nick at nickfitz.co.uk Thu Sep 7 05:54:18 2006 From: nick at nickfitz.co.uk (Nick Fitzsimons) Date: Thu, 7 Sep 2006 11:54:18 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <7.0.1.0.2.20060907032250.022014b0@juniperwebcraft.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> <7.0.1.0.2.20060907032250.022014b0@juniperwebcraft.com> Message-ID: <253B6914-0FE8-462F-861E-D9148EC20C05@nickfitz.co.uk> On 7 Sep 2006, at 11:33, Paul Novitski wrote: > At 9/6/2006 11:07 PM, Jonathan Buchanan wrote: >> On 9/7/06, Terry Riegel wrote: >>> >>> I modified it slightly to include the type of node being swapped. >>> >>> function swapNodes(n1, n2, k) >>> { >>> var placeHolder = document.createElement(k); >>> n1.parentNode.replaceChild(placeHolder, n1); >>> n2.parentNode.replaceChild(n1, n2); >>> placeHolder.parentNode.replaceChild(n2, placeHolder); >>> } >>> >>> Is there some type of cleanup needed to remove the temporary node >>> (placeHolder)? Or is it local to the function and gets removed >>> automatically? >> >> As placeHolder is declared using "var", it's local to the function. >> When the function returns, placeHolder is not attached to the >> document >> any more and there are no other references to it hanging around, >> so it >> should get removed automatically. > > > Jonathan, I suspect you're wrong on this point. While I agree that > the variable 'placeHolder' is local to the function 'swapNodes()' > and will be cleared when the function terminates, surely when you > invoke the DOM method createElement() you're creating a new element > IN THE DOM which has got to be about as global as you can get in a > script running in the context of the Document Object Model. > Am I wrong about this? Does the createElement() method return a > node object that isn't actually part of the DOM and doesn't persist > when the calling function returns? > If you examine a node returned by createElement you will see that it has no parentNode; it isn't part of the DOM tree until it is explicitly inserted into the tree. In this case it is inserted and then removed, so the only remaining reference to it is in the local variable. Therefore it should be available for garbage collection when the function terminates. Cheers, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ From jonathan.buchanan at gmail.com Thu Sep 7 06:10:57 2006 From: jonathan.buchanan at gmail.com (Jonathan Buchanan) Date: Thu, 7 Sep 2006 12:10:57 +0100 Subject: [Javascript] Changing an Objects ID and Name In-Reply-To: <7.0.1.0.2.20060907032250.022014b0@juniperwebcraft.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <7.0.1.0.2.20060906075810.05d65ff8@juniperwebcraft.com> <3B79390A-C187-4865-A0E5-E4F23A4913E2@clearimageonline.com> <7.0.1.0.2.20060907032250.022014b0@juniperwebcraft.com> Message-ID: On 9/7/06, Paul Novitski wrote: > Jonathan, I suspect you're wrong on this point. While I agree that > the variable 'placeHolder' is local to the function 'swapNodes()' and > will be cleared when the function terminates, surely when you invoke > the DOM method createElement() you're creating a new element IN THE > DOM which has got to be about as global as you can get in a script > running in the context of the Document Object Model. > > Am I wrong about this? Does the createElement() method return a node > object that isn't actually part of the DOM and doesn't persist when > the calling function returns? > > Regards, > Paul Correct - the element returned from the createElement function isn't actually in the document's DOM tree until you insert it. The element holds a reference to its ownerDocument, but the ownerDocument doesn't hold a reference to the element. The situation is the same after the element has been inserted and then removed from the DOM tree. So when the function terminates, placeHolder is a locally scoped variable to which there are no references. Jonathan. From riegel at clearimageonline.com Thu Sep 7 09:48:33 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 10:48:33 -0400 Subject: [Javascript] How do I build a simple array In-Reply-To: <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> Message-ID: Hello All, How do I remove the first item from an array? Terry From leeu at cfl.rr.com Thu Sep 7 10:05:08 2006 From: leeu at cfl.rr.com (Lee Underwood) Date: Thu, 07 Sep 2006 11:05:08 -0400 Subject: [Javascript] How do I build a simple array In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> Message-ID: <7.0.1.0.0.20060907110430.01fc5f00@cfl.rr.com> You can do that using the shift() method. Think of it as taking the first element and "shifting" it to the left, out of the array. You can do it using the following format. var chevCar = new Array("Nova","Impala","Corvette"); alert("The original lineup is " + chevCar); chevCar.shift(); alert("The new lineup is " + chevCar); The first part of the script works just like the previous above. However, after displaying all of the elements, it removes the first one and displays an alert window with the remaining two elements. (See: http://www.webreference.com/programming/javascript/diaries/13/4.html) Lee Underwood Jupitermedia Corporation Managing Editor WebDeveloper.com | ScriptSearch | JavaScript Source | TheCounter | TheGuestbook Associate Editor WebReference.com On 9/7/2006 10:48 AM, Terry Riegel wrote: ........................................................ >Hello All, > >How do I remove the first item from an array? > >Terry ........................................................ -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Thu Sep 7 10:06:53 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 11:06:53 -0400 Subject: [Javascript] How do I build a simple array In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> Message-ID: <75EA554D-22CF-4270-8B70-35DE0D6458C4@clearimageonline.com> Found it, array.shift() Terry On Sep 7, 2006, at 10:48 AM, Terry Riegel wrote: > Hello All, > > How do I remove the first item from an array? > > Terry > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From riegel at clearimageonline.com Thu Sep 7 10:13:08 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 11:13:08 -0400 Subject: [Javascript] I have hit a brick wall In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> Message-ID: <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> Hello, For some reason I can't seem to get my head around this problem. I was able to get a swapImages() function working yesterday to basically swap 2 images out. I think my work on that is clouding my thinking for the problem before me. Can someone help me with my logic. I have an array of Objects (actually their ID's) like i[0] = 'imageA' i[1] = 'imageB' i[2] = 'imageC' i[3] = 'imageD' i[4] = 'imageE' i[5] = 'imageF' and I would like move imageA to the last position, and ripple all the others up. So the result would be... i[0] = 'imageB' i[1] = 'imageC' i[2] = 'imageD' i[3] = 'imageE' i[4] = 'imageF' i[5] = 'imageA' For some reason this seems like a simple problem, but I can't seem to come up with the logic for executing it. Any Ideas? Terry From jonathan.buchanan at gmail.com Thu Sep 7 10:17:56 2006 From: jonathan.buchanan at gmail.com (Jonathan Buchanan) Date: Thu, 7 Sep 2006 16:17:56 +0100 Subject: [Javascript] I have hit a brick wall In-Reply-To: <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> Message-ID: On 9/7/06, Terry Riegel wrote: > Hello, > > For some reason I can't seem to get my head around this problem. I > was able to get a swapImages() function working yesterday to > basically swap 2 images out. I think my work on that is clouding my > thinking for the problem before me. Can someone help me with my logic. > > I have an array of Objects (actually their ID's) like > > > i[0] = 'imageA' > i[1] = 'imageB' > i[2] = 'imageC' > i[3] = 'imageD' > i[4] = 'imageE' > i[5] = 'imageF' > > and I would like move imageA to the last position, and ripple all the > others up. So the result would be... > > i[0] = 'imageB' > i[1] = 'imageC' > i[2] = 'imageD' > i[3] = 'imageE' > i[4] = 'imageF' > i[5] = 'imageA' > > For some reason this seems like a simple problem, but I can't seem to > come up with the logic for executing it. Any Ideas? > > Terry i.push(i.shift()); Regards, Jonathan. From riegel at clearimageonline.com Thu Sep 7 10:33:44 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 11:33:44 -0400 Subject: [Javascript] I have hit a brick wall In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> Message-ID: <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> Thanks Jonathan, That works for the array, but I need to swap out the objects represented by the ID. I need soemthing similar to the swapNodes() function you wrote yesterday. This is my humble (non-working) attempt so far. function rippleNodes(a,k) { var placeHolder = document.createElement(k); var i=document.getElementById(a[0]) for (x=0; x On 9/7/06, Terry Riegel wrote: >> Hello, >> >> For some reason I can't seem to get my head around this problem. I >> was able to get a swapImages() function working yesterday to >> basically swap 2 images out. I think my work on that is clouding my >> thinking for the problem before me. Can someone help me with my >> logic. >> >> I have an array of Objects (actually their ID's) like >> >> >> i[0] = 'imageA' >> i[1] = 'imageB' >> i[2] = 'imageC' >> i[3] = 'imageD' >> i[4] = 'imageE' >> i[5] = 'imageF' >> >> and I would like move imageA to the last position, and ripple all the >> others up. So the result would be... >> >> i[0] = 'imageB' >> i[1] = 'imageC' >> i[2] = 'imageD' >> i[3] = 'imageE' >> i[4] = 'imageF' >> i[5] = 'imageA' >> >> For some reason this seems like a simple problem, but I can't seem to >> come up with the logic for executing it. Any Ideas? >> >> Terry > > i.push(i.shift()); > > Regards, > Jonathan. > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From scott at randomchaos.com Thu Sep 7 11:16:43 2006 From: scott at randomchaos.com (Scott Reynen) Date: Thu, 7 Sep 2006 11:16:43 -0500 Subject: [Javascript] I have hit a brick wall In-Reply-To: <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> Message-ID: <49D7BA95-F897-46CF-81C8-4E3A57CC4C58@randomchaos.com> On Sep 7, 2006, at 10:33 AM, Terry Riegel wrote: > I need soemthing similar to the swapNodes() function you wrote > yesterday. > > This is my humble (non-working) attempt so far. > > > function rippleNodes(a,k) > { > var placeHolder = document.createElement(k); > var i=document.getElementById(a[0]) > for (x=0; x { > if (x==0) > { > i.parentNode.replaceChild(placeHolder,i) > } > else > { > var n=document.getElementById(a[x]) > var n1=document.getElementById(a[x-1]) > n.parentNode.replaceChild(n1,n) > } > } > placeHolder.parentNode.replaceChild(i, placeHolder); > } How about this (untested): function bubbleUpNodes(a) // where a is array of IDs { for ( x=1; x References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> Message-ID: On 9/7/06, Terry Riegel wrote: > Thanks Jonathan, > > That works for the array, but I need to swap out the objects > represented by the ID. I need soemthing similar to the swapNodes() > function you wrote yesterday. > > This is my humble (non-working) attempt so far. > > > function rippleNodes(a,k) > { > var placeHolder = document.createElement(k); > var i=document.getElementById(a[0]) > for (x=0; x { > if (x==0) > { > i.parentNode.replaceChild(placeHolder,i) > } > else > { > var n=document.getElementById(a[x]) > var n1=document.getElementById(a[x-1]) > n.parentNode.replaceChild(n1,n) > } > } > placeHolder.parentNode.replaceChild(i, placeHolder); > } > > > Terry The implementation of this really depends on the specifics of how the document is structured. Moving each and every node one at a time is a last resort, as you can structure your document in a way which makes it easy to manipulate as you desire. For example, if the nodes in question are arranged like so: parent |-- child1 |-- child2 |-- child3 ...then moving child1 to the end is as simple as child1.parentNode.appendChild(child1). Similarly, if each node you're interested in is wrapped in its own container element, but the container elements are the only children of some common parent element, you do exactly the same, but operating on child1.parentNode instead of child1. Is for the same page as before? Jonathan. From riegel at clearimageonline.com Thu Sep 7 12:48:48 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 7 Sep 2006 13:48:48 -0400 Subject: [Javascript] I have hit a brick wall In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> Message-ID: <4F9B4FC7-81F3-450C-BEC0-F90C79ADC583@clearimageonline.com> Basically I have a bunch of Images that a user can drag one to another location and when they drop the image it detects where they dropped it and then it generates a list of the images that need to be moved. I am now at the point where I need to move the images. I have already implemented Scott's BubbleUpNodes() function and it seems to be working so far. I am not sure if there is an easier way to do this. Now I just need to communicate these changes back to the server via AJAX. Thanks, Terry Riegel On Sep 7, 2006, at 12:18 PM, Jonathan Buchanan wrote: > On 9/7/06, Terry Riegel wrote: >> Thanks Jonathan, >> >> That works for the array, but I need to swap out the objects >> represented by the ID. I need soemthing similar to the swapNodes() >> function you wrote yesterday. >> >> This is my humble (non-working) attempt so far. >> >> >> function rippleNodes(a,k) >> { >> var placeHolder = document.createElement(k); >> var i=document.getElementById(a[0]) >> for (x=0; x> { >> if (x==0) >> { >> i.parentNode.replaceChild(placeHolder,i) >> } >> else >> { >> var n=document.getElementById(a[x]) >> var n1=document.getElementById(a[x-1]) >> n.parentNode.replaceChild(n1,n) >> } >> } >> placeHolder.parentNode.replaceChild(i, placeHolder); >> } >> >> >> Terry > > The implementation of this really depends on the specifics of how the > document is structured. Moving each and every node one at a time is a > last resort, as you can structure your document in a way which makes > it easy to manipulate as you desire. > > For example, if the nodes in question are arranged like so: > > parent > |-- child1 > |-- child2 > |-- child3 > > ...then moving child1 to the end is as simple as > child1.parentNode.appendChild(child1). > > Similarly, if each node you're interested in is wrapped in its own > container element, but the container elements are the only children of > some common parent element, you do exactly the same, but operating on > child1.parentNode instead of child1. > > Is for the same page as before? > > Jonathan. > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From joel.goldstick at columbuswebmakers.com Thu Sep 7 15:06:40 2006 From: joel.goldstick at columbuswebmakers.com (joel.goldstick at columbuswebmakers.com) Date: Thu, 07 Sep 2006 16:06:40 -0400 Subject: [Javascript] I have hit a brick wall In-Reply-To: References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> Message-ID: <45007BD0.1020606@columbuswebmakers.com> > > i.push(i.shift()); > While the looping methods outlined may be easier to understand, this line of code is a gem! My guess is that it also runs faster. No need to know how many items in the array either. So, if this looks strange, do a little study on stacks and lists. These are long time standard constructs for those who studied programming in college courses, but are most likely missed by the many who are learning to code by the seat of their pants! -- Joel Goldstick www.columbuswebmakers.com From scott at randomchaos.com Thu Sep 7 16:09:44 2006 From: scott at randomchaos.com (Scott Reynen) Date: Thu, 7 Sep 2006 16:09:44 -0500 Subject: [Javascript] I have hit a brick wall In-Reply-To: <45007BD0.1020606@columbuswebmakers.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <45007BD0.1020606@columbuswebmakers.com> Message-ID: On Sep 7, 2006, at 3:06 PM, joel.goldstick at columbuswebmakers.com wrote: >> i.push(i.shift()); > While the looping methods outlined may be easier to understand, > this line of code is a gem! My guess is that it also runs faster. > No need to know how many items in the array either. > > So, if this looks strange, do a little study on stacks and lists. > These are long time standard constructs for those who studied > programming in college courses, but are most likely missed by the > many who are learning to code by the seat of their pants! While the above code is ideal for arrays, DOM nodes are in a tree, not an array. The general concept could still be applied if you know in advance the exact structure of the DOM tree, as Jonathon said, but that doesn't seem to be the case for this particular problem. Peace, Scott From riegel at clearimageonline.com Fri Sep 8 14:17:58 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Fri, 8 Sep 2006 15:17:58 -0400 Subject: [Javascript] Walking the DOM In-Reply-To: <4F9B4FC7-81F3-450C-BEC0-F90C79ADC583@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> <4F9B4FC7-81F3-450C-BEC0-F90C79ADC583@clearimageonline.com> Message-ID: <625F77F1-D8BD-4F73-86AF-DBB54AE9F8B0@clearimageonline.com> If I have the following markup...
  • My Favorite Photos (58)
  • and... in my javascript I have... o=document.getElementById('album01'); How do I reference (with the intent of changing) the content of the anchor? My goal is to replace the text with an updated number from the server, but I need a method to replace the text. As a side question should I be using innerHTML, or is there a better method. If anyone is using prototype and knows of a method through that library that would be helpful. Thanks, Terry From peter at brunone.com Fri Sep 8 14:49:10 2006 From: peter at brunone.com (Peter Brunone) Date: Fri, 8 Sep 2006 12:49:10 -0700 Subject: [Javascript] Walking the DOM Message-ID: Wouldn't that just be o.childNodes[0].innerHTML ? Of course I may have misunderstood the question... From: Terry Riegel riegel at clearimageonline.com If I have the following markup... My Favorite Photos (58) and... in my javascript I have... o=document.getElementById('album01'); How do I reference (with the intent of changing) the content of the anchor? My goal is to replace the text with an updated number from the server, but I need a method to replace the text. As a side question should I be using innerHTML, or is there a better method. If anyone is using prototype and knows of a method through that library that would be helpful. Thanks, Terry -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwarden at gmail.com Fri Sep 8 17:33:24 2006 From: mwarden at gmail.com (Matt Warden) Date: Fri, 8 Sep 2006 18:33:24 -0400 Subject: [Javascript] Walking the DOM In-Reply-To: <625F77F1-D8BD-4F73-86AF-DBB54AE9F8B0@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> <4F9B4FC7-81F3-450C-BEC0-F90C79ADC583@clearimageonline.com> <625F77F1-D8BD-4F73-86AF-DBB54AE9F8B0@clearimageonline.com> Message-ID: On 9/8/06, Terry Riegel wrote: > If I have the following markup... > >
  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have... > > o=document.getElementById('album01'); > > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful. var li = document.getElementById('album01'); var anchor = li.firstChild; var textNode = anchor.firstChild; http://www.devguru.com/technologies/xmldom/QuickRef/node_replaceChild.html -- Matt Warden Cleveland, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. From trojani2000 at hotmail.com Fri Sep 8 19:17:42 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sat, 9 Sep 2006 00:17:42 +0000 Subject: [Javascript] Walking the DOM Message-ID: But you don't need to change the href="album01.html". Is that correct?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: riegel at clearimageonline.com> Subject: [Javascript] Walking the DOM> Date: Fri, 8 Sep 2006 15:17:58 -0400> To: javascript at LaTech.edu> > If I have the following markup...> >
  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have...> > o=document.getElementById('album01');> > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful.> > > > Thanks,> > Terry> _______________________________________________> Javascript mailing list> Javascript at LaTech.edu> https://lists.LaTech.edu/mailman/listinfo/javascript _________________________________________________________________ Use Messenger to talk to your IM friends, even those on Yahoo! http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Fri Sep 8 23:33:38 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Sat, 9 Sep 2006 00:33:38 -0400 Subject: [Javascript] Walking the DOM In-Reply-To: References: Message-ID: <85314384-22AF-433D-8440-BAE8F05F759D@clearimageonline.com> Correct On Sep 8, 2006, at 8:17 PM, Troy III Ajnej wrote: > But you don't need to change the href="album01.html". > Is that correct? > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Troy III > progressive art enterprise > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > From: riegel at clearimageonline.com > > Subject: [Javascript] Walking the DOM > > Date: Fri, 8 Sep 2006 15:17:58 -0400 > > To: javascript at LaTech.edu > > > > If I have the following markup... > > > >
  • My Favorite > > Photos (58)
  • > > > > > > > > and... in my javascript I have... > > > > o=document.getElementById('album01'); > > > > > > > > How do I reference (with the intent of changing) the content of the > > anchor? My goal is to replace the text with an updated number from > > the server, but I need a method to replace the text. As a side > > question should I be using innerHTML, or is there a better > method. If > > anyone is using prototype and knows of a method through that library > > that would be helpful. > > > > > > > > Thanks, > > > > Terry > > _______________________________________________ > > Javascript mailing list > > Javascript at LaTech.edu > > https://lists.LaTech.edu/mailman/listinfo/javascript > > > Use Messenger to talk to your IM friends, even those on Yahoo! Talk > now! > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at juniperwebcraft.com Sat Sep 9 00:25:57 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Fri, 08 Sep 2006 22:25:57 -0700 Subject: [Javascript] Walking the DOM In-Reply-To: <625F77F1-D8BD-4F73-86AF-DBB54AE9F8B0@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <5014EE81-8D55-44F8-9016-B5405EFF8A0F@clearimageonline.com> <0F89F915-CCE4-4E3D-A16A-5E9E4847E486@datacompusa.com> <11A63BA1-3627-40E4-BF50-55611B9F506F@clearimageonline.com> <45EEF86E-8A5B-4B21-9F7F-6D1842DA70BC@clearimageonline.com> <794B2F6D-DEF2-4059-A01E-1AFDA9E46794@clearimageonline.com> <4F9B4FC7-81F3-450C-BEC0-F90C79ADC583@clearimageonline.com> <625F77F1-D8BD-4F73-86AF-DBB54AE9F8B0@clearimageonline.com> Message-ID: <7.0.1.0.2.20060908220618.05f31560@juniperwebcraft.com> At 9/8/2006 12:17 PM, Terry Riegel wrote: >If I have the following markup... > >
  • My Favorite >Photos (58)
  • > >and... in my javascript I have... > > o=document.getElementById('album01'); > >How do I reference (with the intent of changing) the content of the >anchor? My goal is to replace the text At 9/8/2006 12:49 PM, Peter Brunone wrote: >Wouldn't that just be o.childNodes[0].innerHTML ? At 9/8/2006 03:33 PM, Matt Warden wrote: >var li = document.getElementById('album01'); >var anchor = li.firstChild; >var textNode = anchor.firstChild; Part of the question will always be: how stable is your markup? For example, if you or anyone else ever changes the HTML by inserting a carriage return between the LI tag and the A, then I believe the firstChild and the first childNode of LI would be a text node (the carriage return) and the anchor would be its next sibling. Perhaps safer would be: o=document.getElementById('album01'); var aAnchors = o.getElementsByTagName("A"); if (aAnchors.length != 1) return alert("Help! Kwazy unexpected markup!"); Then your one and only expected anchor is aAnchors[0]. Again, if the contents of the anchor is a single text string then it will indeed be the firstChild, but if anyone ever inserts a SPAN or EM then you'll have two or more childNodes. In the Gecko DOM Reference it suggests an iterative approach to removing all the children of a parent: // remove all children from element var element = document.getElementById("top"); while (element.firstChild) { element.removeChild(element.firstChild); } http://developer.mozilla.org/en/docs/DOM:element.removeChild#Example With respect to innerHTML, the reference says: "Though not actually a part of the W3C DOM specification, this property provides a simple way to completely replace the contents of an element. ... As there is no public specification for this property, implementations differ widely. For example, when text is entered into a text input, IE will change the value attribute of the input's innerHTML property but Gecko browsers do not." http://developer.mozilla.org/en/docs/DOM:element.innerHTML#Notes I take that to mean that using removeChild is the safer course, although you might get away with using innerHTML with few complaints. Paul From peter at brunone.com Sat Sep 9 00:38:54 2006 From: peter at brunone.com (Peter Brunone) Date: Fri, 8 Sep 2006 22:38:54 -0700 Subject: [Javascript] Walking the DOM Message-ID: <2adff6087a52416e9230b186ed883074@brunone.com> Ah so. I stand corrected. Funny, too, since I've taken to using the getElementsByTagName approach lately anyway... From: Paul Novitski paul at juniperwebcraft.com At 9/8/2006 12:17 PM, Terry Riegel wrote: >If I have the following markup... > > My Favorite >Photos (58) > >and... in my javascript I have... > > o=document.getElementById('album01'); > >How do I reference (with the intent of changing) the content of the >anchor? My goal is to replace the text At 9/8/2006 12:49 PM, Peter Brunone wrote: >Wouldn't that just be o.childNodes[0].innerHTML ? At 9/8/2006 03:33 PM, Matt Warden wrote: >var li = document.getElementById('album01'); >var anchor = li.firstChild; >var textNode = anchor.firstChild; Part of the question will always be: how stable is your markup? For example, if you or anyone else ever changes the HTML by inserting a carriage return between the LI tag and the A, then I believe the firstChild and the first childNode of LI would be a text node (the carriage return) and the anchor would be its next sibling. Perhaps safer would be: o=document.getElementById('album01'); var aAnchors = o.getElementsByTagName("A"); if (aAnchors.length != 1) return alert("Help! Kwazy unexpected markup!"); Then your one and only expected anchor is aAnchors[0]. Again, if the contents of the anchor is a single text string then it will indeed be the firstChild, but if anyone ever inserts a SPAN or EM then you'll have two or more childNodes. In the Gecko DOM Reference it suggests an iterative approach to removing all the children of a parent: // remove all children from element var element = document.getElementById("top"); while (element.firstChild) { element.removeChild(element.firstChild); } http://developer.mozilla.org/en/docs/DOM:element.removeChild#Example With respect to innerHTML, the reference says: "Though not actually a part of the W3C DOM specification, this property provides a simple way to completely replace the contents of an element. ... As there is no public specification for this property, implementations differ widely. For example, when text is entered into a text input, IE will change the value attribute of the input's innerHTML property but Gecko browsers do not." http://developer.mozilla.org/en/docs/DOM:element.innerHTML#Notes I take that to mean that using removeChild is the safer course, although you might get away with using innerHTML with few complaints. Paul _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From asureshkumar_1983 at yahoo.co.in Sat Sep 9 00:55:03 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Sat, 9 Sep 2006 06:55:03 +0100 (BST) Subject: [Javascript] virual memory proeblem Message-ID: <20060909055503.96452.qmail@web8614.mail.in.yahoo.com> Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Turner at Project-Network.com Sat Sep 9 04:04:02 2006 From: Alex.Turner at Project-Network.com (Alex Turner) Date: Sat, 9 Sep 2006 10:04:02 +0100 Subject: [Javascript] virual memory proeblem In-Reply-To: <20060909055503.96452.qmail@web8614.mail.in.yahoo.com> Message-ID: <9EFC04356BBC4745B67A41B106F4A47A01BCDE67@TPN-EX01.PROJECT-NETWORK.COM> Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. HYPERLINK "http://www.deployview.com"www.deployview.com HYPERLINK "http://www.nerds-central.blogspot.com"www.nerds-central.blogspot.com HYPERLINK "http://www.project-network.com"www.project-network.com _____ From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 09 September 2006 06:55 To: javascript at latech.edu Subject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. _____ Find out what India is talking about on - HYPERLINK "http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/"Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. HYPERLINK "http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com"Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: From asureshkumar_1983 at yahoo.co.in Sat Sep 9 06:03:35 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Sat, 9 Sep 2006 12:03:35 +0100 (BST) Subject: [Javascript] virual memory proeblem In-Reply-To: <9EFC04356BBC4745B67A41B106F4A47A01BCDE67@TPN-EX01.PROJECT-NETWORK.COM> Message-ID: <20060909110335.27240.qmail@web8608.mail.in.yahoo.com> Hi, thxs for reply,but we are not only displaying only the image ad ,we are displaying image ad using object,flash and movie ad using object and text ad using

    object. fior displaying the first ad i am using appendchild() function and then i am using replacechild() function that will replace the current playing ad with the new one. my request is is there any common object that will display image,text ,movie and flash ad.i am new to this javascript field.tnxs for reply A.suresh Alex Turner wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) } Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. www.deployview.com www.nerds-central.blogspot.com www.project-network.com --------------------------------- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 09 September 2006 06:55 To: javascript at latech.edu Subject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Sat Sep 9 16:07:53 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Sat, 9 Sep 2006 17:07:53 -0400 Subject: [Javascript] virual memory proeblem In-Reply-To: <20060909110335.27240.qmail@web8608.mail.in.yahoo.com> References: <20060909110335.27240.qmail@web8608.mail.in.yahoo.com> Message-ID: This may not be a good solution, but what if you reloaded the page every hour, wouldn't that clean out any stuff that isn't being used on that page and start fresh? Terry On Sep 9, 2006, at 7:03 AM, suresh kumar wrote: > > Hi, > thxs for reply,but we are not only displaying only the image > ad ,we are displaying image ad using object,flash and movie > ad using object and text ad using

    object. fior > displaying the first ad i am using appendchild() function and then > i am using replacechild() function that will replace the current > playing ad with the new one. > my request is is there any common object that will display > image,text ,movie and flash ad.i am new to this javascript > field.tnxs for reply > > > A.suresh > Alex Turner wrote: > Suresh, > > It sounds like for some reason you are creating image objects all > the time and they are not being garbage collected. Truth be told, > browsers are not really designed to do this sort of thing, so even > if your code is theoretically correct, you might have to ?help it > along? a bit to get the browser to behave properly. > > I would suggest that you use one image and cycle its src attribute > instead. > > To do the preload, again use one image object which is not actually > displayed and cycle its src until all are in the cache. The > browser cache is at the url level not the object level, so there is > no requirement to store image objects for the data they contain to > be cached. > > Hope it helps. > > AJ > > Alexander J Turner Ph.D. > www.deployview.com > www.nerds-central.blogspot.com > www.project-network.com > From: javascript-bounces at LaTech.edu [mailto:javascript- > bounces at LaTech.edu] On Behalf Of suresh kumar > Sent: 09 September 2006 06:55 > To: javascript at latech.edu > Subject: [Javascript] virual memory proeblem > > Hi, > I am facing one problem in my project.i am working in myadtv > project that will display ads one by one in big LCD screen . > > suppose if i want display 100 ads one by one for a particular > duration,after displaying the 100 th ad again it will start from 1 > ad and goes in a loop until the user closes the browser. > > my problem is ,if its runs for continuously more than 10 hours > if am displaying the message as > " your system virtual memory is too > low,windows is increasing the size of the virtual memory paging > file ,during this process memory request for some application may > be denied". i can't understand this error message ,can any one > tell me what this errror message. > > the logc behind our code - we are using > javascript "imagepreloader() function to load the ads in the > browser cache once it gets loaded then it will start displaying one > by one. > > > > > Find out what India is talking about on - Yahoo! Answers India > Send FREE SMS to your friend's mobile from Yahoo! Messenger Version > 8. Get it NOW > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: > 08/09/2006 > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: > 08/09/2006 > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > > > Find out what India is talking about on - Yahoo! Answers India > Send FREE SMS to your friend's mobile from Yahoo! Messenger Version > 8. Get it NOW > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Sun Sep 10 03:41:15 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sun, 10 Sep 2006 08:41:15 +0000 Subject: [Javascript] Walking the DOM Message-ID: I think you are in need for o=document.getElementById('album01'); o.innerText=... (an IE extension introduced ten years ago having in mind exactly the type of applications you are building right now), but since other browsers don't support ityou are left with W3C conditionals and a long walk... (meaning count children check for node type identify the correct textnode) Regards~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: riegel at clearimageonline.comSubject: Re: [Javascript] Walking the DOMDate: Sat, 9 Sep 2006 00:33:38 -0400To: javascript at LaTech.eduCorrect On Sep 8, 2006, at 8:17 PM, Troy III Ajnej wrote: But you don't need to change the href="album01.html". Is that correct?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: riegel at clearimageonline.com> Subject: [Javascript] Walking the DOM> Date: Fri, 8 Sep 2006 15:17:58 -0400> To: javascript at LaTech.edu> > If I have the following markup...> >

  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have...> > o=document.getElementById('album01');> > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful.> > > > Thanks,> > Terry> _______________________________________________> Javascript mailing list> Javascript at LaTech.edu> https://lists.LaTech.edu/mailman/listinfo/javascript Use Messenger to talk to your IM friends, even those on Yahoo! Talk now! _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _________________________________________________________________ Use Messenger to talk to your IM friends, even those on Yahoo! http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Sun Sep 10 03:55:18 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sun, 10 Sep 2006 08:55:18 +0000 Subject: [Javascript] virual memory proeblem Message-ID: I think, the first thing to do is make sure the script tag resides inside the document body. (the place where it legally belongs) Second thing to do is, modify your script to call the preloader function only once, not every time you run the script. If this fails the third thing in mind would be to use "meta" expire at least every hour. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: riegel at clearimageonline.comSubject: Re: [Javascript] virual memory proeblemDate: Sat, 9 Sep 2006 17:07:53 -0400To: javascript at LaTech.eduThis may not be a good solution, but what if you reloaded the page every hour, wouldn't that clean out any stuff that isn't being used on that page and start fresh? Terry On Sep 9, 2006, at 7:03 AM, suresh kumar wrote: Hi, thxs for reply,but we are not only displaying only the image ad ,we are displaying image ad using object,flash and movie ad using object and text ad using

    object. fior displaying the first ad i am using appendchild() function and then i am using replacechild() function that will replace the current playing ad with the new one. my request is is there any common object that will display image,text ,movie and flash ad.i am new to this javascript field.tnxs for reply A.sureshAlex Turner wrote: Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. www.deployview.comwww.nerds-central.blogspot.comwww.project-network.com From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumarSent: 09 September 2006 06:55To: javascript at latech.eduSubject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. _________________________________________________________________ Express yourself with gadgets on Windows Live Spaces http://discoverspaces.live.com?source=hmtag1&loc=us -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Sun Sep 10 05:53:49 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Sun, 10 Sep 2006 06:53:49 -0400 Subject: [Javascript] Walking the DOM In-Reply-To: References: Message-ID: <9CCA4AC6-242B-4D9F-A435-F59ADA344B60@clearimageonline.com> If o.innerText is IE only, and still possible with lots of work in other browsers could a general function be created to work in all browsers and then added to a library, such as prototype to make life easier for future use? Terry On Sep 10, 2006, at 4:41 AM, Troy III Ajnej wrote: > I think you are in need for > > o=document.getElementById('album01'); > o.innerText=... > > (an IE extension introduced ten years ago > having in mind exactly the type of applications > you are building right now), > > but since other browsers don't support it > you are left with W3C conditionals and a long > walk... > (meaning count children check for node type identify the correct > textnode) > Regards > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Troy III > progressive art enterprise > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > From: riegel at clearimageonline.com > Subject: Re: [Javascript] Walking the DOM > Date: Sat, 9 Sep 2006 00:33:38 -0400 > To: javascript at LaTech.edu > > Correct > > > > > On Sep 8, 2006, at 8:17 PM, Troy III Ajnej wrote: > > But you don't need to change the href="album01.html". > Is that correct? > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Troy III > progressive art enterprise > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > From: riegel at clearimageonline.com > > Subject: [Javascript] Walking the DOM > > Date: Fri, 8 Sep 2006 15:17:58 -0400 > > To: javascript at LaTech.edu > > > > If I have the following markup... > > > >

  • My Favorite > > Photos (58)
  • > > > > > > > > and... in my javascript I have... > > > > o=document.getElementById('album01'); > > > > > > > > How do I reference (with the intent of changing) the content of the > > anchor? My goal is to replace the text with an updated number from > > the server, but I need a method to replace the text. As a side > > question should I be using innerHTML, or is there a better > method. If > > anyone is using prototype and knows of a method through that library > > that would be helpful. > > > > > > > > Thanks, > > > > Terry > > _______________________________________________ > > Javascript mailing list > > Javascript at LaTech.edu > > https://lists.LaTech.edu/mailman/listinfo/javascript > > > Use Messenger to talk to your IM friends, even those on Yahoo! Talk > now! > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > > > Use Messenger to talk to your IM friends, even those on Yahoo! Talk > now! > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Sun Sep 10 07:37:49 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sun, 10 Sep 2006 12:37:49 +0000 Subject: [Javascript] Walking the DOM Message-ID: In these cases the best thing to do is a workaround, improvise: o=document.getElementById('album01'); o.innerHTML = "" + MyFavPhotos_Var + "<\/a>"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: riegel at clearimageonline.comSubject: Re: [Javascript] Walking the DOMDate: Sun, 10 Sep 2006 06:53:49 -0400To: javascript at LaTech.edu If o.innerText is IE only, and still possible with lots of work in other browsers could a general function be created to work in all browsers and then added to a library, such as prototype to make life easier for future use? Terry On Sep 10, 2006, at 4:41 AM, Troy III Ajnej wrote: I think you are in need for o=document.getElementById('album01'); o.innerText=... (an IE extension introduced ten years agohaving in mind exactly the type of applicationsyou are building right now), but since other browsers don't support ityou are left with W3C conditionals and a longwalk...(meaning count children check for node type identify the correct textnode)Regards~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: riegel at clearimageonline.comSubject: Re: [Javascript] Walking the DOMDate: Sat, 9 Sep 2006 00:33:38 -0400To: javascript at LaTech.eduCorrect On Sep 8, 2006, at 8:17 PM, Troy III Ajnej wrote: But you don't need to change the href="album01.html". Is that correct?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: riegel at clearimageonline.com> Subject: [Javascript] Walking the DOM> Date: Fri, 8 Sep 2006 15:17:58 -0400> To: javascript at LaTech.edu> > If I have the following markup...> >
  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have...> > o=document.getElementById('album01');> > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful.> > > > Thanks,> > Terry> _______________________________________________> Javascript mailing list> Javascript at LaTech.edu> https://lists.LaTech.edu/mailman/listinfo/javascript Use Messenger to talk to your IM friends, even those on Yahoo! Talk now! _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript Use Messenger to talk to your IM friends, even those on Yahoo! Talk now! _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _________________________________________________________________ Check the weather nationwide with MSN Search: Try it now! http://search.msn.com/results.aspx?q=weather&FORM=WLMTAG -------------- next part -------------- An HTML attachment was scrubbed... URL: From asureshkumar_1983 at yahoo.co.in Sun Sep 10 08:26:39 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Sun, 10 Sep 2006 14:26:39 +0100 (BST) Subject: [Javascript] virual memory proeblem In-Reply-To: Message-ID: <20060910132639.22666.qmail@web8610.mail.in.yahoo.com> sir,i can can't get ur reply ,i want to display image,flash,movie and text ads by using common object.right now i am using replacechild(). i will give you an example ,suppose i am displaying the image ad using object,my next ad to display is flash means i will create object and i am using repalcechild() to replace current ad with new one.and it will go in loop. i am receiving this error message if i run it for continuously more than 12 hours - "your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". my request is is there any common object that will display image,text ,movie and flash files .i am new to this javascript field.tnxs for reply Terry Riegel wrote: This may not be a good solution, but what if you reloaded the page every hour, wouldn't that clean out any stuff that isn't being used on that page and start fresh? Terry On Sep 9, 2006, at 7:03 AM, suresh kumar wrote: Hi, thxs for reply,but we are not only displaying only the image ad ,we are displaying image ad using object,flash and movie ad using object and text ad using

    object. fior displaying the first ad i am using appendchild() function and then i am using replacechild() function that will replace the current playing ad with the new one. my request is is there any common object that will display image,text ,movie and flash ad.i am new to this javascript field.tnxs for reply A.suresh Alex Turner wrote: Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. www.deployview.com www.nerds-central.blogspot.com www.project-network.com --------------------------------- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 09 September 2006 06:55 To: javascript at latech.edu Subject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From asureshkumar_1983 at yahoo.co.in Sun Sep 10 08:29:50 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Sun, 10 Sep 2006 14:29:50 +0100 (BST) Subject: [Javascript] virual memory proeblem In-Reply-To: Message-ID: <20060910132950.74078.qmail@web8607.mail.in.yahoo.com> sir,i can can't get ur reply ,i want to display image,flash,movie and text ads by using common object.right now i am using replacechild(). i will give you an example ,suppose i am displaying the image ad using object,my next ad to display is flash means i will create object and i am using repalcechild() to replace current ad with new one.and it will go in loop. i am receiving this error message if i run it for continuously more than 12 hours - "your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". my request is is there any common object that will display image,text ,movie and flash files .i am new to this javascript field.tnxs for reply Terry Riegel wrote: This may not be a good solution, but what if you reloaded the page every hour, wouldn't that clean out any stuff that isn't being used on that page and start fresh? Terry On Sep 9, 2006, at 7:03 AM, suresh kumar wrote: Hi, thxs for reply,but we are not only displaying only the image ad ,we are displaying image ad using object,flash and movie ad using object and text ad using

    object. fior displaying the first ad i am using appendchild() function and then i am using replacechild() function that will replace the current playing ad with the new one. my request is is there any common object that will display image,text ,movie and flash ad.i am new to this javascript field.tnxs for reply A.suresh Alex Turner wrote: Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. www.deployview.com www.nerds-central.blogspot.com www.project-network.com --------------------------------- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 09 September 2006 06:55 To: javascript at latech.edu Subject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Turner at Project-Network.com Sun Sep 10 08:59:10 2006 From: Alex.Turner at Project-Network.com (Alex Turner) Date: Sun, 10 Sep 2006 14:59:10 +0100 Subject: [Javascript] virual memory proeblem In-Reply-To: <20060910132950.74078.qmail@web8607.mail.in.yahoo.com> Message-ID: <9EFC04356BBC4745B67A41B106F4A47A01BCDE9A@TPN-EX01.PROJECT-NETWORK.COM> Here is a thought, run the advertising page in an iframe. Ever so often, by javascript in the enclosing page, just refresh the iframe from the server, say once every hours. AH Alexander J Turner Ph.D. HYPERLINK "http://www.deployview.com"www.deployview.com HYPERLINK "http://www.nerds-central.blogspot.com"www.nerds-central.blogspot.com HYPERLINK "http://www.project-network.com"www.project-network.com _____ From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 10 September 2006 14:30 To: [JavaScript List] Subject: Re: [Javascript] virual memory proeblem sir,i can can't get ur reply ,i want to display image,flash,movie and text ads by using common object.right now i am using replacechild(). i will give you an example ,suppose i am displaying the image ad using object,my next ad to display is flash means i will create object and i am using repalcechild() to replace current ad with new one.and it will go in loop. i am receiving this error message if i run it for continuously more than 12 hours - "your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". my request is is there any common object that will display image,text ,movie and flash files .i am new to this javascript field.tnxs for reply Terry Riegel wrote: This may not be a good solution, but what if you reloaded the page every hour, wouldn't that clean out any stuff that isn't being used on that page and start fresh? Terry On Sep 9, 2006, at 7:03 AM, suresh kumar wrote: Hi, thxs for reply,but we are not only displaying only the image ad ,we are displaying image ad using object,flash and movie ad using object and text ad using

    object. fior displaying the first ad i am using appendchild() function and then i am using replacechild() function that will replace the current playing ad with the new one. my request is is there any common object that will display image,text ,movie and flash ad.i am new to this javascript field.tnxs for reply A.suresh Alex Turner wrote: Suresh, It sounds like for some reason you are creating image objects all the time and they are not being garbage collected. Truth be told, browsers are not really designed to do this sort of thing, so even if your code is theoretically correct, you might have to ?help it along? a bit to get the browser to behave properly. I would suggest that you use one image and cycle its src attribute instead. To do the preload, again use one image object which is not actually displayed and cycle its src until all are in the cache. The browser cache is at the url level not the object level, so there is no requirement to store image objects for the data they contain to be cached. Hope it helps. AJ Alexander J Turner Ph.D. HYPERLINK "http://www.deployview.com/"www.deployview.com HYPERLINK "http://www.nerds-central.blogspot.com/"www.nerds-central.blogspot.com HYPERLINK "http://www.project-network.com/"www.project-network.com _____ From: javascript-bounces at LaTech.edu [HYPERLINK "mailto:javascript-bounces at LaTech.edu"mailto:javascript-bounces at LaTech.edu] On Behalf Of suresh kumar Sent: 09 September 2006 06:55 To: HYPERLINK "mailto:javascript at latech.edu"javascript at latech.edu Subject: [Javascript] virual memory proeblem Hi, I am facing one problem in my project.i am working in myadtv project that will display ads one by one in big LCD screen . suppose if i want display 100 ads one by one for a particular duration,after displaying the 100 th ad again it will start from 1 ad and goes in a loop until the user closes the browser. my problem is ,if its runs for continuously more than 10 hours if am displaying the message as " your system virtual memory is too low,windows is increasing the size of the virtual memory paging file ,during this process memory request for some application may be denied". i can't understand this error message ,can any one tell me what this errror message. the logc behind our code - we are using javascript "imagepreloader() function to load the ads in the browser cache once it gets loaded then it will start displaying one by one. _____ Find out what India is talking about on - HYPERLINK "http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/"Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. HYPERLINK "http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com"Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 _______________________________________________ Javascript mailing list HYPERLINK "mailto:Javascript at LaTech.edu"Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _____ Find out what India is talking about on - HYPERLINK "http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/"Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. HYPERLINK "http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com"Get it NOW _______________________________________________ Javascript mailing list HYPERLINK "mailto:Javascript at LaTech.edu"Javascript at LaTech.edu HYPERLINK "https://lists.latech.edu/mailman/listinfo/javascript"https://lists.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript _____ Find out what India is talking about on - HYPERLINK "http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/"Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. HYPERLINK "http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com"Get it NOW -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 08/09/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: From shanex.fael at gmail.com Sun Sep 10 13:17:15 2006 From: shanex.fael at gmail.com (Rafael Santos) Date: Sun, 10 Sep 2006 15:17:15 -0300 Subject: [Javascript] How to Detect User Inactivity Message-ID: Hey... does any one knows hwo gmail detects its window inactivity and then make a XHR request?? Which event does it uses.. i cant figure out... =O -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at jwarner.com Sun Sep 10 14:30:33 2006 From: john at jwarner.com (John Warner) Date: Sun, 10 Sep 2006 15:30:33 -0400 Subject: [Javascript] How to Detect User Inactivity In-Reply-To: Message-ID: <076501c6d50f$95afa5e0$6b01a8c0@earth> Pick any events (Mouse and keyboard) reset your timeout with use, do nothing with no activity. John Warner -----Original Message----- From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of Rafael Santos Sent: Sunday, September 10, 2006 2:17 PM To: [JavaScript List] Subject: [Javascript] How to Detect User Inactivity Hey... does any one knows hwo gmail detects its window inactivity and then make a XHR request?? Which event does it uses.. i cant figure out... =O -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at brunone.com Mon Sep 11 09:20:36 2006 From: peter at brunone.com (Peter Brunone) Date: Mon, 11 Sep 2006 07:20:36 -0700 Subject: [Javascript] Walking the DOM Message-ID: Google for "HTML strip function" and you should get a few good ones. Then again, I'm confused as to why you'd need innerText if all you have is text in the link. The innerHTML property does not return the tag of the element itself; that's outerHTML, which is a whole different issue. Cheers, Peter From: Terry Riegel riegel at clearimageonline.com If o.innerText is IE only, and still possible with lots of work in other browsers could a general function be created to work in all browsers and then added to a library, such as prototype to make life easier for future use? Terry On Sep 10, 2006, at 4:41 AM, Troy III Ajnej wrote: I think you are in need for o=document.getElementById('album01'); o.innerText =... (an IE extension introduced ten years ago having in mind exactly the type of applications you are building right now), but since other browsers don't support it you are left with W3C conditionals and a long walk... (meaning count children check for node type identify the correct textnode) Regards From: riegel at clearimageonline.com Correct On Sep 8, 2006, at 8:17 PM, Troy III Ajnej wrote:But you don't need to change the href="album01.html". Is that correct? > From: riegel at clearimageonline.com > If I have the following markup... > >

  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have... > > o=document.getElementById('album01'); > > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful. > > > > Thanks, > > Terry -------------- next part -------------- An HTML attachment was scrubbed... URL: From asureshkumar_1983 at yahoo.co.in Mon Sep 11 10:43:30 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Mon, 11 Sep 2006 16:43:30 +0100 (BST) Subject: [Javascript] how can i display movie in center of the browser verically and horizontally Message-ID: <20060911154330.14424.qmail@web8613.mail.in.yahoo.com> Hi to all, I want to display the movie in the center of the browser both vertically and horozontally,but right now its displaying center -horizontally but not verically. i also tired out valign='middle' but its not working for me.i dont know the reason.can any some help me this is my code
    this.picObj = document.createElement('EMBED'); this.picObj.setAttribute('id',"aShow"); this.picObj.setAttribute('width','640'); this.picObj.setAttribute('height' ,'480'); this.picObj.src = 'movie.mpeg'; oDis=document.getElementById('iedisplayarea'); this.picObj= oDis.appendChild(this.picObj); --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at brunone.com Mon Sep 11 11:25:55 2006 From: peter at brunone.com (Peter Brunone) Date: Mon, 11 Sep 2006 09:25:55 -0700 Subject: [Javascript] how can i display movie in center of the browser verically and horizontally Message-ID: <683107735fc94238b5edc1de639f3b8d@brunone.com> This may be a silly question, but is the table (or surrounding element) smaller than 640x480? setting a visible border on your tables and other elements will usually help you to troubleshoot this. Cheers, Peter From: suresh kumar asureshkumar_1983 at yahoo.co.in Hi to all, I want to display the movie in the center of the browser both vertically and horozontally,but right now its displaying center -horizontally but not verically. i also tired out valign='middle' but its not working for me.i dont know the reason.can any some help me this is my code
    this.picObj = document.createElement('EMBED'); this.picObj.setAttribute('id',"aShow"); this.picObj.setAttribute('width','640'); this.picObj.setAttribute('height' ,'480'); this.picObj.src = 'movie.mpeg'; oDis=document.getElementById('iedisplayarea'); this.picObj= oDis.appendChild(this.picObj); -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Mon Sep 11 11:51:48 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Mon, 11 Sep 2006 16:51:48 +0000 Subject: [Javascript] Walking the DOM Message-ID: "Peter Brunone" Then again, I'm confused as to why you'd need innerText if all you have is text in the link. The innerHTML property does not return the tag of the element itself; that's outerHTML, which is a whole different issue. That's because he is referencing his no name, A tag element from its parent List Item ID.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >
  • My Favorite > Photos (58)
  • > > > > and... in my javascript I have...> > o=document.getElementById('album01');> > > > How do I reference (with the intent of changing) the content of the > anchor? My goal is to replace the text with an updated number from > the server, but I need a method to replace the text. As a side > question should I be using innerHTML, or is there a better method. If > anyone is using prototype and knows of a method through that library > that would be helpful.> > > > Thanks,> > Terry _________________________________________________________________ Check the weather nationwide with MSN Search: Try it now! http://search.msn.com/results.aspx?q=weather&FORM=WLMTAG -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrique.renno at gmail.com Mon Sep 11 12:56:34 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Mon, 11 Sep 2006 14:56:34 -0300 Subject: [Javascript] Mapping Image Message-ID: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> Hello!!! I'd like to know if it's possible to map points in an image in order to show some information about them in an area of the page. The idea is to move the cursor over a point and make appear a menu on the left giving some options. Thanks for the attention!!! -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Mon Sep 11 13:11:44 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Mon, 11 Sep 2006 18:11:44 +0000 Subject: [Javascript] Mapping Image Message-ID: please make a search ismap usemap html and see what suits you ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Date: Mon, 11 Sep 2006 14:56:34 -0300From: henrique.renno at gmail.comTo: javascript at latech.eduCC: Subject: [Javascript] Mapping ImageHello!!!I'd like to know if it's possible to map points in an image in order to show some information about them in an area of the page. The idea is to move the cursor over a point and make appear a menu on the left giving some options. Thanks for the attention!!!-- Henrique _________________________________________________________________ Express yourself with gadgets on Windows Live Spaces http://discoverspaces.live.com?source=hmtag1&loc=us -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Mon Sep 11 13:16:30 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Mon, 11 Sep 2006 14:16:30 -0400 Subject: [Javascript] Drag and Drop Photo Album In-Reply-To: <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> Message-ID: <541BA8F5-9229-4767-86E1-DAC0C25A823F@clearimageonline.com> Hello everyone, Thank you for all your help. I feel like I have taken another step in becoming a "Real" (if there is such a thing) javascript programmer. In the last few weeks I have gone from cutting and pasting code to actually writing my own functions from scratch. It has been very exciting to learn JS. I still feel like I am taking baby steps but have found this group invaluable. I have in the last few weeks worked on 3 "major" javascript applications. 1 - My file manager, 2 - an upload tool (with progress indicators), and 3 - A Drag & Drop Photo Album. I am very excited about my drag & Drop Photo Album because (so far) it seems to work on all of the browsers I have tested it with. I also have a non- javascript version in case someone can't work with the drag and drop. If anyone is interested in seeing the application go to youbelong.net, and look at some of the journals. The photo Album is the third tab. This only shows the end user side, so if you would like to see how the drag and drop part works drop me an email and I will set up a demo site for you to see the drag and drop stuff. Once again thanks everyone for all your help. Terry Riegel On Sep 6, 2006, at 8:56 AM, Terry Riegel wrote: > Hello, > > I would like to swap out an image in an application I am writing. > Basically I want to swap two image tags, the trick is I want to > swap their ID and NAME tags also. > > For example, I have the following HTML... > > > ... > > ... > > ... > > > that I would like to use javacscript to make into... > > ... > > ... > > ... > > The important thing Is I would like to swap all of the attributes > out. i.e. width,height,id,name,src > > Thanks, > > Terry Riegel > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From paul at juniperwebcraft.com Mon Sep 11 13:42:12 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Mon, 11 Sep 2006 11:42:12 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com > References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> Message-ID: <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> At 9/11/2006 10:56 AM, Henrique Renn? wrote: >I'd like to know if it's possible to map points >in an image in order to show some information >about them in an area of the page. The idea is >to move the cursor over a point and make appear >a menu on the left giving some options. The easy way is to apply mouseover behavior to the image that triggers the menu display automatically: var oImage = document.getElementById("imageId"); if (oImage) { oImage.onmouseover = fnMenuShow; oImage.onmouseout = fnMenuHide; { If you ever need to calculate whether a point on the screen is over the image, you can do it this way: 1) Discover the image's exact X/Y position, for example: http://www.quirksmode.org/js/findpos.html 2) You know or can discover its width and length, e.g. oImage.pixelWidth etc. 3) You're over the image if the mouse is: to the right of its left edge and to the left of its right edge and below its top edge and above its bottom edge MouseX >= imageLeft && MouseX <= imageLeft + imageWidth && MouseY >= imageTop && MouseY <= imageTop + imageHeight Regards, Paul From riegel at clearimageonline.com Mon Sep 11 14:05:09 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Mon, 11 Sep 2006 15:05:09 -0400 Subject: [Javascript] Drag and Drop Photo Album In-Reply-To: <541BA8F5-9229-4767-86E1-DAC0C25A823F@clearimageonline.com> References: <20060904021333.DBA4D12003@smtp2.LaTech.edu> <20060904090646.GA26749@us-lot.org> <4E4A2D2F-8FEC-4DF4-A2B7-F268F5E973A4@clearimageonline.com> <541BA8F5-9229-4767-86E1-DAC0C25A823F@clearimageonline.com> Message-ID: I set up a demo site for everyone to look at. http://www.youbelong.net/javascriptone If you would like to log in send me an email and I can get you set up. Terry On Sep 11, 2006, at 2:16 PM, Terry Riegel wrote: > Hello everyone, > > Thank you for all your help. I feel like I have taken another step > in becoming a "Real" (if there is such a thing) javascript > programmer. In the last few weeks I have gone from cutting and > pasting code to actually writing my own functions from scratch. It > has been very exciting to learn JS. I still feel like I am taking > baby steps but have found this group invaluable. > > I have in the last few weeks worked on 3 "major" javascript > applications. 1 - My file manager, 2 - an upload tool (with > progress indicators), and 3 - A Drag & Drop Photo Album. I am very > excited about my drag & Drop Photo Album because (so far) it seems > to work on all of the browsers I have tested it with. I also have a > non-javascript version in case someone can't work with the drag and > drop. > > If anyone is interested in seeing the application go to > youbelong.net, and look at some of the journals. The photo Album is > the third tab. This only shows the end user side, so if you would > like to see how the drag and drop part works drop me an email and I > will set up a demo site for you to see the drag and drop stuff. > > Once again thanks everyone for all your help. > > > Terry Riegel > > > > On Sep 6, 2006, at 8:56 AM, Terry Riegel wrote: > >> Hello, >> >> I would like to swap out an image in an application I am writing. >> Basically I want to swap two image tags, the trick is I want to >> swap their ID and NAME tags also. >> >> For example, I have the following HTML... >> >> >> ... >> >> ... >> >> ... >> >> >> that I would like to use javacscript to make into... >> >> ... >> >> ... >> >> ... >> >> The important thing Is I would like to swap all of the attributes >> out. i.e. width,height,id,name,src >> >> Thanks, >> >> Terry Riegel >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From flavio at economisa.com.br Mon Sep 11 15:21:15 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Mon, 11 Sep 2006 17:21:15 -0300 Subject: [Javascript] Mapping Image In-Reply-To: <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> Message-ID: <4505C53B.1020007@economisa.com.br> Wouldn't be the use of the tags MAP and AREA a good choice for this case? Are they "off"standard? http://www.w3schools.com/tags/tag_map.asp http://www.w3schools.com/tags/tag_area.asp <-- W3Schools say it suppors onmouseover, click, etc Paul Novitski escreveu: > At 9/11/2006 10:56 AM, Henrique Renn? wrote: > >> I'd like to know if it's possible to map points in an image in order >> to show some information about them in an area of the page. The idea >> is to move the cursor over a point and make appear a menu on the left >> giving some options. > > > > The easy way is to apply mouseover behavior to the image that triggers > the menu display automatically: > > var oImage = document.getElementById("imageId"); > if (oImage) > { > oImage.onmouseover = fnMenuShow; > oImage.onmouseout = fnMenuHide; > { > > If you ever need to calculate whether a point on the screen is over > the image, you can do it this way: > > 1) Discover the image's exact X/Y position, for example: > http://www.quirksmode.org/js/findpos.html > > 2) You know or can discover its width and length, e.g. > oImage.pixelWidth etc. > > 3) You're over the image if the mouse is: > > to the right of its left edge > and to the left of its right edge > and below its top edge > and above its bottom edge > > MouseX >= imageLeft > && MouseX <= imageLeft + imageWidth > && MouseY >= imageTop > && MouseY <= imageTop + imageHeight > > Regards, > Paul > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -- Flavio Gomes flavio at economisa.com.br From paul at juniperwebcraft.com Mon Sep 11 16:22:15 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Mon, 11 Sep 2006 14:22:15 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <4505C53B.1020007@economisa.com.br> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> Message-ID: <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> At 9/11/2006 01:21 PM, Fl?vio Gomes wrote: >Wouldn't be the use of the tags MAP and AREA a good choice for this case? > >Are they "off"standard? > >http://www.w3schools.com/tags/tag_map.asp >http://www.w3schools.com/tags/tag_area.asp <-- >W3Schools say it suppors onmouseover, click, etc You're right -- what I failed to read into Henrique's posting was his need to have multiple hover areas behind the image. Interestingly, this can be accomplished purely in CSS, without JavaScript: Stu Nichols' CSS image maps: http://www.cssplay.co.uk/menu/imap.html http://www.cssplay.co.uk/menu/old_master.html http://www.cssplay.co.uk/menu/image_map.html Paul From tedd at sperling.com Mon Sep 11 17:20:56 2006 From: tedd at sperling.com (tedd) Date: Mon, 11 Sep 2006 18:20:56 -0400 Subject: [Javascript] Mapping Image In-Reply-To: <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> Message-ID: >Interestingly, this can be accomplished purely in CSS, without JavaScript: > >Stu Nichols' CSS image maps: >http://www.cssplay.co.uk/menu/imap.html The map #1 and #2 break in Safari 2.0.4, but #3 works fine. >http://www.cssplay.co.uk/menu/old_master.html >http://www.cssplay.co.uk/menu/image_map.html These two work fine as well. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From henrique.renno at gmail.com Tue Sep 12 07:09:52 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Tue, 12 Sep 2006 09:09:52 -0300 Subject: [Javascript] Mapping Image In-Reply-To: References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> Message-ID: <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> Hello all!!! Thanks for all the answers!!! I knew about map inside html tags but as I'm new to JavaScript what I wanted was something like the oldmaster css example where I point over a part of an image and some information appears beside the image. What I really want to do is to show a menu whenever some predefined map is activated with the "over" event and keep it active until the user pass over another point or click in a free area of the page. Is there a menu option in JavaScript (like a menu object with methods) ???? Thanks again!!! On 9/11/06, tedd wrote: > > >Interestingly, this can be accomplished purely in CSS, without > JavaScript: > > > >Stu Nichols' CSS image maps: > >http://www.cssplay.co.uk/menu/imap.html > > The map #1 and #2 break in Safari 2.0.4, but #3 works fine. > > >http://www.cssplay.co.uk/menu/old_master.html > >http://www.cssplay.co.uk/menu/image_map.html > > These two work fine as well. > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrique.renno at gmail.com Tue Sep 12 08:28:49 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Tue, 12 Sep 2006 10:28:49 -0300 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> Message-ID: <3e7bcb580609120628h2227fd94w2af169b64c56cbb5@mail.gmail.com> Just adding some doubts. Is there a way of using CSS and define a polygon for the mapping like the shape option of the map tag in html or it's possible to define just rectangles???? Thanks!!! On 9/12/06, Henrique Renn? wrote: > > Hello all!!! > > Thanks for all the answers!!! I knew about map inside html tags but as I'm > new to JavaScript what I wanted was something like the oldmaster css example > where I point over a part of an image and some information appears beside > the image. What I really want to do is to show a menu whenever some > predefined map is activated with the "over" event and keep it active until > the user pass over another point or click in a free area of the page. Is > there a menu option in JavaScript (like a menu object with methods) ???? > > Thanks again!!! > > -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at juniperwebcraft.com Tue Sep 12 10:17:58 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Tue, 12 Sep 2006 08:17:58 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.co m> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> Message-ID: <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> At 9/12/2006 05:09 AM, Henrique Renn? wrote: >Thanks for all the answers!!! I knew about map >inside html tags but as I'm new to JavaScript >what I wanted was something like the oldmaster >css example where I point over a part of an >image and some information appears beside the >image. What I really want to do is to show a >menu whenever some predefined map is activated >with the "over" event and keep it active until >the user pass over another point or click in a >free area of the page. Is there a menu option in >JavaScript (like a menu object with methods) ???? One way to freeze a menu on the screen until the next trigger event is with CSS class. Consider this: ... .menu { position: absolute; left: -1000em; } body.menu01 div#menu01, body.menu01 div#menu01 { position: static; } All the menus are hidden from view until a hover event sets the body class to match one of the menus. That menu will remain displayed until another event occurs change the body class. The usual way to accomplish this purely in JavaScript is to keep track of the currently-displayed menu and switch off its display properties when switching on the next. I prefer the CSS method above because it so nearly separates the event-triggering behavior from the mechanism that determines how an element is displayed or hidden. Regards, Paul From paul at juniperwebcraft.com Tue Sep 12 13:26:18 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Tue, 12 Sep 2006 11:26:18 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> Message-ID: <7.0.1.0.2.20060912112502.021d6130@juniperwebcraft.com> At 9/12/2006 08:17 AM, Paul Novitski wrote: > > ... > > > > > .menu > { > position: absolute; > left: -1000em; > } > > body.menu01 div#menu01, > body.menu01 div#menu01 > { > position: static; > } I meant: body.menu01 div#menu01, body.menu02 div#menu02 { position: static; } Typing too hastily, Paul From henrique.renno at gmail.com Wed Sep 13 11:26:28 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Wed, 13 Sep 2006 13:26:28 -0300 Subject: [Javascript] Mapping Image In-Reply-To: <7.0.1.0.2.20060912112502.021d6130@juniperwebcraft.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> <7.0.1.0.2.20060912112502.021d6130@juniperwebcraft.com> Message-ID: <3e7bcb580609130926q27202c0bye96e19511f250b30@mail.gmail.com> Hello!!! As I said before I just started learning CSS and I'm not understanding so well how things work. I've attached the html file that I did and I'd like to know if someone could take a look. What I want to do is to freeze the menu when the mouse passes over some predefined region in the image refering to this menu and make it disappear when another region is activated (turning on another menu) or when the user clicks over a region without any event associated with. If the menu disappears I think that even "The Flash" could not get a chance to choose an option!! Thanks for you help!! On 9/12/06, Paul Novitski wrote: > > At 9/12/2006 08:17 AM, Paul Novitski wrote: > > > > ... > > > > > > > > > > .menu > > { > > position: absolute; > > left: -1000em; > > } > > > > body.menu01 div#menu01, > > body.menu02 div#menu02 > > { > > position: static; > > } > -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrique.renno at gmail.com Wed Sep 13 12:06:32 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Wed, 13 Sep 2006 14:06:32 -0300 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609130926q27202c0bye96e19511f250b30@mail.gmail.com> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> <7.0.1.0.2.20060912112502.021d6130@juniperwebcraft.com> <3e7bcb580609130926q27202c0bye96e19511f250b30@mail.gmail.com> Message-ID: <3e7bcb580609131006i46009af7k5ffe647e9333f109@mail.gmail.com> Hello again! Just one more question. Is there a way to zoom in and zoom out part of an image? Like make two buttons for zoom in and out to change the image visualization. Thanks! Regards -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: From miles at allnovascotia.com Wed Sep 13 15:23:35 2006 From: miles at allnovascotia.com (Miles Thompson) Date: Wed, 13 Sep 2006 17:23:35 -0300 Subject: [Javascript] Image popup works, but fails if there is a query string Message-ID: <6.1.1.1.0.20060913170035.0b975d08@mx.allnovascotia.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.3/446 - Release Date: 9/12/2006 From paul at juniperwebcraft.com Wed Sep 13 18:50:03 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Wed, 13 Sep 2006 16:50:03 -0700 Subject: [Javascript] Image popup works, but fails if there is a query string In-Reply-To: <6.1.1.1.0.20060913170035.0b975d08@mx.allnovascotia.com> References: <6.1.1.1.0.20060913170035.0b975d08@mx.allnovascotia.com> Message-ID: <7.0.1.0.2.20060913164729.041ec4a0@juniperwebcraft.com> At 9/13/2006 01:23 PM, Miles Thompson wrote: >I have a PHP page with a Javascript image popup function in the >area. Page layout is by CSS. You can see it here: >http://www.allnovascotia.com/test/sandwichchef/index.php Menu >buttons on the side reload the page, and a value passed in the URL >controls what is loaded and displayed in the centre column. If the >page is loaded with NO query string, just .../sandwichchef/index.php >the popup works fine. If Ctrl+R is pressed to reload the page, no >problem. If the page is loaded WITH a query string (or one of the >buttons is clicked), such as ../sandwichchef/index.php?pgget=1, the >popup script executes, but no picture is loaded , just a black box >with a missing image symbol. Nothing shows up in the Javascript >console. Is the problem the reliance of the popup code on passing an >URL, but the browser already has a different query string stored? >Here's a link to the main page: >http://www.allnovascotia.com/test/sandwichchef/index.phps The >included files contain nothing but text. The popup page (popPic.htm) >is v. short and is presented below my signature. I'm really puzzled >and suggestions / guidance will be most welcome. Regards - Miles >Thompson popPic.htm: I clicked on an image and got a pop-up with a broken image, the source of which is: http://www.allnovascotia.com/test/sandwichchef/index.php./graphics/sandwichTray.jpg Note the badly-formed URL, e.g. "index.php./" Paul From miles at allnovascotia.com Wed Sep 13 20:16:05 2006 From: miles at allnovascotia.com (Miles Thompson) Date: Wed, 13 Sep 2006 22:16:05 -0300 Subject: [Javascript] Image popup works, but fails if there is a query string In-Reply-To: <7.0.1.0.2.20060913164729.041ec4a0@juniperwebcraft.com> References: <6.1.1.1.0.20060913170035.0b975d08@mx.allnovascotia.com> <7.0.1.0.2.20060913164729.041ec4a0@juniperwebcraft.com> Message-ID: <6.1.1.1.0.20060913221507.02d2ec18@mx.allnovascotia.com> At 08:50 PM 9/13/2006, Paul Novitski wrote: >At 9/13/2006 01:23 PM, Miles Thompson wrote: >>I have a PHP page with a Javascript image popup function in the area. >>Page layout is by CSS. You can see it here: >>http://www.allnovascotia.com/test/sandwichchef/index.php Menu buttons on >>the side reload the page, and a value passed in the URL controls what is >>loaded and displayed in the centre column. If the page is loaded with NO >>query string, just .../sandwichchef/index.php the popup works fine. If >>Ctrl+R is pressed to reload the page, no problem. If the page is loaded >>WITH a query string (or one of the buttons is clicked), such as >>../sandwichchef/index.php?pgget=1, the popup script executes, but no >>picture is loaded , just a black box with a missing image symbol. Nothing >>shows up in the Javascript console. Is the problem the reliance of the >>popup code on passing an URL, but the browser already has a different >>query string stored? Here's a link to the main page: >>http://www.allnovascotia.com/test/sandwichchef/index.phps The included >>files contain nothing but text. The popup page (popPic.htm) is v. short >>and is presented below my signature. I'm really puzzled and suggestions / >>guidance will be most welcome. Regards - Miles Thompson popPic.htm: > > >I clicked on an image and got a pop-up with a broken image, the source of >which is: >http://www.allnovascotia.com/test/sandwichchef/index.php./graphics/sandwichTray.jpg > >Note the badly-formed URL, e.g. "index.php./" > >Paul >_______________________________________________ >Javascript mailing list >Javascript at LaTech.edu >https://lists.LaTech.edu/mailman/listinfo/javascript Paul, Thank you. I've fixed it temporarily by hardcoding the URL; I will have to do some string processing for a permanent fix. Miles -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.3/446 - Release Date: 9/12/2006 From trojani2000 at hotmail.com Wed Sep 13 20:18:14 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Thu, 14 Sep 2006 01:18:14 +0000 Subject: [Javascript] Mapping Image Message-ID: You are not clear.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Date: Wed, 13 Sep 2006 13:26:28 -0300From: henrique.renno at gmail.comTo: javascript at latech.eduSubject: Re: [Javascript] Mapping ImageCC: Hello!!!As I said before I just started learning CSS and I'm not understanding so well how things work. I've attached the html file that I did and I'd like to know if someone could take a look. What I want to do is to freeze the menu when the mouse passes over some predefined region in the image refering to this menu and make it disappear when another region is activated (turning on another menu) or when the user clicks over a region without any event associated with. If the menu disappears I think that even "The Flash" could not get a chance to choose an option!! Thanks for you help!! On 9/12/06, Paul Novitski wrote: At 9/12/2006 08:17 AM, Paul Novitski wrote:> > ...> > >>> .menu> {> position: absolute;> left: -1000em;> }>> body.menu01 div#menu01,> body.menu02 div#menu02> {> position: static;> }-- Henrique _________________________________________________________________ Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today! http://get.live.com/toolbar/overview -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Wed Sep 13 20:19:45 2006 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Thu, 14 Sep 2006 01:19:45 +0000 Subject: [Javascript] Mapping Image Message-ID: Yes, IE can do it, -don't know about others!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Date: Wed, 13 Sep 2006 14:06:32 -0300From: henrique.renno at gmail.comTo: javascript at latech.eduSubject: Re: [Javascript] Mapping ImageCC: Hello again!Just one more question. Is there a way to zoom in and zoom out part of an image? Like make two buttons for zoom in and out to change the image visualization.Thanks!Regards-- Henrique _________________________________________________________________ Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today! http://get.live.com/toolbar/overview -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at juniperwebcraft.com Thu Sep 14 00:00:33 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Wed, 13 Sep 2006 22:00:33 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609131006i46009af7k5ffe647e9333f109@mail.gmail.co m> References: <3e7bcb580609111056r73bb098pb11c71082a40d4a9@mail.gmail.com> <7.0.1.0.2.20060911112827.05df6650@juniperwebcraft.com> <4505C53B.1020007@economisa.com.br> <7.0.1.0.2.20060911141334.054da338@juniperwebcraft.com> <3e7bcb580609120509v2cb14836tebfd97fcbb54c66f@mail.gmail.com> <7.0.1.0.2.20060912075907.06069e60@juniperwebcraft.com> <7.0.1.0.2.20060912112502.021d6130@juniperwebcraft.com> <3e7bcb580609130926q27202c0bye96e19511f250b30@mail.gmail.com> <3e7bcb580609131006i46009af7k5ffe647e9333f109@mail.gmail.com> Message-ID: <7.0.1.0.2.20060913215501.03cc2460@juniperwebcraft.com> At 9/13/2006 10:06 AM, Henrique Renn? wrote: >Just one more question. Is there a way to zoom >in and zoom out part of an image? Like make two >buttons for zoom in and out to change the image visualization. It's hard to know exactly what you're visualizing with such a brief description. You could have two copies of the image on the server, one small and one large. Click on the small to reveal the large. Or you could divide the large image into segments, and reveal a large segment each time you click on the corresponding segment of the small image. Or you could create a magnifying glass metaphor to follow the mouse-pointer when you're over the small image. The large image is the background image of the magnifying glass, although only a part of it is revealed at any one time. As you move the mouse-pointer over the small image, the CSS background-position of the magnifying glass shifts accordingly. Regards, Paul From henrique.renno at gmail.com Thu Sep 14 07:02:10 2006 From: henrique.renno at gmail.com (=?ISO-8859-1?Q?Henrique_Renn=F3?=) Date: Thu, 14 Sep 2006 09:02:10 -0300 Subject: [Javascript] Mapping Image In-Reply-To: References: Message-ID: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> Hello!! This is the code. Change "sun.gif" for any other image. You'll see what this code does when you point the cursor over two different regions. What I want to do is to freeze the menu to have time to choose some options and turn it off if the second region is pointed over or when clicking in any free area and vice-versa. Thanks! Code: Testing CSS with Menus
    Some text should be written here.
    On 9/13/06, Troy III Ajnej wrote: > > You are not clear. > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Troy III > progressive art enterprise > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ------------------------------ > Date: Wed, 13 Sep 2006 13:26:28 -0300 > > > From: henrique.renno at gmail.com > To: javascript at latech.edu > Subject: Re: [Javascript] Mapping Image > CC: > > > Hello!!! > > As I said before I just started learning CSS and I'm not understanding so > well how things work. I've attached the html file that I did and I'd like to > know if someone could take a look. What I want to do is to freeze the menu > when the mouse passes over some predefined region in the image refering to > this menu and make it disappear when another region is activated (turning on > another menu) or when the user clicks over a region without any event > associated with. If the menu disappears I think that even "The Flash" could > not get a chance to choose an option!! > > Thanks for you help!! > > On 9/12/06, *Paul Novitski* wrote: > > At 9/12/2006 08:17 AM, Paul Novitski wrote: > > > > ... > > > > > > > > > > .menu > > { > > position: absolute; > > left: -1000em; > > } > > > > body.menu01 div#menu01, > > body.menu02 div#menu02 > > { > > position: static; > > } > > > -- > Henrique > > ------------------------------ > Search from any Web page with powerful protection. Get the FREE Windows > Live Toolbar Today! Try it now! > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > > > -- Henrique -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at juniperwebcraft.com Thu Sep 14 10:05:11 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Thu, 14 Sep 2006 08:05:11 -0700 Subject: [Javascript] Mapping Image In-Reply-To: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com > References: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> Message-ID: <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> At 9/14/2006 05:02 AM, Henrique Renn? wrote: > You'll see what this code does when you point > the cursor over two different regions. What I > want to do is to freeze the menu to have time > to choose some options and turn it off if the > second region is pointed over or when clicking > in any free area and vice-versa. Right. Now you can add rules that reference the body class like so: #picture A#part1:hover, #picture A#part2:hover, body.part1 A#part1, body.part2 A#part2 {border:2px solid #cc0;} If you do that for each of the :hover rules, then your javascript can set the body className to your part id and the hover state will stick until the body class changes again. There are other ways to do this as well. I like the CSS method because a) the javascript logic is extremely simple and b) all the presentational details of how things look is confined to the stylesheet. ______________________ By the way, this style rule is redundant: #picture A#part1 {...} Because Ids are unique on the page, there can be only one #part1, so you don't need to specify its parent. ______________________ Also, these rules are redundant: #picture A#part1:hover, #picture A#part2:hover Given your markup, you can probably replace them with one rule: #picture A:hover ______________________ >This is the code. Change "sun.gif" for any other image. Next time, please upload the page and images to your own server and send us the URL. It's a lot to ask busy people to create a page and an image just to see what you're working on. ______________________ Regards, Paul From mdougherty at pbp.com Thu Sep 14 13:29:25 2006 From: mdougherty at pbp.com (Mike Dougherty) Date: Thu, 14 Sep 2006 14:29:25 -0400 Subject: [Javascript] Mapping Image In-Reply-To: <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> References: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> Message-ID: Do you think the redundancy has a negative impact on performance that outweighs the increased readability that this notation provides? Aside from the unlikely case of needing to arbitrarily increase specificity by doubling up the Id the selector, I think it can be useful to identify for the developer that the ID selector is a child of another element in the markup. Is there a reason I should specifically NOT do that? On Thu, 14 Sep 2006 08:05:11 -0700 Paul Novitski wrote: > By the way, this style rule is redundant: > > #picture A#part1 {...} > > Because Ids are unique on the page, there can be only one #part1, so you don't need to specify >its parent. From paul at juniperwebcraft.com Thu Sep 14 14:46:07 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Thu, 14 Sep 2006 12:46:07 -0700 Subject: [Javascript] multiple id CSS selectors [WAS: Mapping Image] In-Reply-To: References: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> Message-ID: <7.0.1.0.2.20060914122858.05523338@juniperwebcraft.com> >>On Thu, 14 Sep 2006 08:05:11 -0700 >> Paul Novitski wrote: >By the way, this style rule is redundant: > #picture A#part1 {...} >Because Ids are unique on the page, there can be only one #part1, so >you don't need to specify its parent. At 9/14/2006 11:29 AM, Mike Dougherty wrote: >Do you think the redundancy has a negative impact on performance >that outweighs the increased readability that this notation >provides? Aside from the unlikely case of needing to arbitrarily >increase specificity by doubling up the Id the selector, I think it >can be useful to identify for the developer that the ID selector is >a child of another element in the markup. > >Is there a reason I should specifically NOT do that? Not that I know of. I haven't ever looked under the hood at a browser's DOM-parsing code so I can't say for sure, but if there is a difference I'm sure it can be measured in microseconds or milliseconds and therefore isn't significant for us big, slow-moving humans. I was just pointing out the redundancy suspecting that the poster may have been new to CSS and thought it was necessary. I enjoy the elegance of minimalist code and enjoy stripping out anything unnecssary. But what's necessary? I agree with you completely. My philosophy is that script is for humans (computers would be content with binary machine language) and that its human readability should be one of the highest priorities for stylistic decisions. I do occasionally use double id selectors when it helps me remember context. Another use of multiple id selectors is in dynamic websites when the ancestral context of a given element can change from one page to another or from one event to another, where it might be desireable to distinguish, say, between: #navbar li#home and: #sidebar li#home or between: body#gallery li#home and: body#contact li#home I fear that we've strayed off-topic... Regards, Paul From mdougherty at pbp.com Thu Sep 14 15:58:08 2006 From: mdougherty at pbp.com (Mike Dougherty) Date: Thu, 14 Sep 2006 16:58:08 -0400 Subject: [Javascript] multiple id CSS selectors [WAS: Mapping Image] In-Reply-To: <7.0.1.0.2.20060914122858.05523338@juniperwebcraft.com> References: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> <7.0.1.0.2.20060914122858.05523338@juniperwebcraft.com> Message-ID: On Thu, 14 Sep 2006 12:46:07 -0700 Paul Novitski wrote: > body#gallery li#home > and: > body#contact li#home > > > I fear that we've strayed off-topic... So? you changed the topic with the change of subject... Then I realized the topic is better suited to css-d :) From nick at nickfitz.co.uk Thu Sep 14 20:01:15 2006 From: nick at nickfitz.co.uk (Nick Fitzsimons) Date: Fri, 15 Sep 2006 02:01:15 +0100 Subject: [Javascript] multiple id CSS selectors [WAS: Mapping Image] In-Reply-To: <7.0.1.0.2.20060914122858.05523338@juniperwebcraft.com> References: <3e7bcb580609140502m31d4a0dp8ba7b60dba953340@mail.gmail.com> <7.0.1.0.2.20060914074654.05015f60@juniperwebcraft.com> <7.0.1.0.2.20060914122858.05523338@juniperwebcraft.com> Message-ID: <4162408A-5D05-4683-B0AD-9BC8E7EC82F6@nickfitz.co.uk> On 14 Sep 2006, at 20:46, Paul Novitski wrote: > > Not that I know of. I haven't ever looked under the hood at a > browser's DOM-parsing code so I can't say for sure, but if there is > a difference I'm sure it can be measured in microseconds or > milliseconds and therefore isn't significant for us big, slow- > moving humans. > For the curious, Dave Hyatt (who used to work on Netscape/Mozilla, and now works on Safari) has an in-depth look at this topic on his old Surfin' Safari blog: Cheers, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ From bernu at lptmc.jussieu.fr Sat Sep 16 12:56:40 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sat, 16 Sep 2006 19:56:40 +0200 Subject: [Javascript] event handlers Message-ID: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> Hi list, I'm very surprised on how browsers behaves with events on nested elements. Only Opera (9.01) sounds to follow the DOM 2. I tried Firefox 1.5.0.7 , Camino 1.0.2 , Safari 2.0.4. Any comments ? Bernard Test
    choose model :
    elem.onev=f
    elem.addEventListener ( eventype , f , true)
    elem.addEventListener ( eventype , f , false)
    stopPropagation = false
    preventDefault = false
    test on this box
    event history=
    -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Thu Sep 21 10:40:17 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 21 Sep 2006 11:40:17 -0400 Subject: [Javascript] Image PreLoad In-Reply-To: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> Message-ID: Hello All, What is a good way to preload a single image? Terry From flavio at economisa.com.br Thu Sep 21 10:49:04 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Thu, 21 Sep 2006 12:49:04 -0300 Subject: [Javascript] Image PreLoad In-Reply-To: References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> Message-ID: <4512B470.3070105@economisa.com.br> myPreload = document.createElement("img"); myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; Maybe this would work too: Both untested =) Terry Riegel escreveu: > Hello All, > > What is a good way to preload a single image? > > Terry > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -- Flavio Gomes flavio at economisa.com.br From riegel at clearimageonline.com Thu Sep 21 13:23:09 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Thu, 21 Sep 2006 14:23:09 -0400 Subject: [Javascript] Image PreLoad In-Reply-To: <4512B470.3070105@economisa.com.br> References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> Message-ID: Sorry, I was unclear in my original post. I would like to preload an image and fire an event once it is loaded. Is this possible? Terrry On Sep 21, 2006, at 11:49 AM, Fl?vio Gomes wrote: > myPreload = document.createElement("img"); > > myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; > > > Maybe this would work too: > > > Both untested =) > > Terry Riegel escreveu: > >> Hello All, >> >> What is a good way to preload a single image? >> >> Terry >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript > > > -- > Flavio Gomes > flavio at economisa.com.br > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From flavio at economisa.com.br Thu Sep 21 13:38:25 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Thu, 21 Sep 2006 15:38:25 -0300 Subject: [Javascript] Image PreLoad In-Reply-To: References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> Message-ID: <4512DC21.50908@economisa.com.br> myPreload = document.createElement("img"); //myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; // A couple of large images to test //myPreload.src = "http://www.plantzafrica.com/vegetation/vegimages/funderstoreyzululand.jpg"; myPreload.src = "http://www.forestserviceni.gov.uk/our_forests/forests/east%20district/images/belvoir/belvoir_1.jpg"; myPreload.onload = function() { alert(" I'm Loaded! "); //Fires on onload document.body.appendChild(myPreload); //Append the image to the document alert(" Here I am! "); //Says "Hello"? =) this.onload = ""; // BUG FIX HERE }; People please test this code for me? On my Mozilla the onload event kept on spamming all the time... Terry Riegel escreveu: > Sorry, I was unclear in my original post. I would like to preload an > image and fire an event once it is loaded. Is this possible? > > Terrry > > > On Sep 21, 2006, at 11:49 AM, Fl?vio Gomes wrote: > >> myPreload = document.createElement("img"); >> >> myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; >> >> >> Maybe this would work too: >> >> >> Both untested =) >> >> Terry Riegel escreveu: >> >>> Hello All, >>> >>> What is a good way to preload a single image? >>> >>> Terry >>> _______________________________________________ >>> Javascript mailing list >>> Javascript at LaTech.edu >>> https://lists.LaTech.edu/mailman/listinfo/javascript >> >> >> >> -- >> Flavio Gomes >> flavio at economisa.com.br >> >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript > > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -- Flavio Gomes flavio at economisa.com.br From nick at nickfitz.co.uk Thu Sep 21 14:11:57 2006 From: nick at nickfitz.co.uk (Nick Fitzsimons) Date: Thu, 21 Sep 2006 20:11:57 +0100 Subject: [Javascript] Image PreLoad In-Reply-To: <4512DC21.50908@economisa.com.br> References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> <4512DC21.50908@economisa.com.br> Message-ID: <966B5EA7-F419-4DF0-BB12-722EB2E45741@nickfitz.co.uk> On 21 Sep 2006, at 19:38, Fl?vio Gomes wrote: > myPreload = document.createElement("img"); > > //myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; > > // A couple of large images to test > > //myPreload.src = "http://www.plantzafrica.com/vegetation/vegimages/ > funderstoreyzululand.jpg"; > > myPreload.src = "http://www.forestserviceni.gov.uk/our_forests/ > forests/east%20district/images/belvoir/belvoir_1.jpg"; > > myPreload.onload = function() { alert(" I'm Loaded! > "); //Fires on onload > document.body.appendChild > (myPreload); //Append the image to the document > alert(" Here I am! > "); //Says "Hello"? =) > this.onload = > ""; // BUG FIX HERE > }; > > > > People please test this code for me? > On my Mozilla the onload event kept on spamming all the time... Hi, The following worked for me on Safari 2.0.4, Firefox 1.5 Mac, Opera 9 Mac, Firefox 1.5 Windows, and IE 6 Windows: var img = document.createElement("img"); img.onerror = function(e) { // this event on the img element is apparently not supported by Safari alert("error loading image"); } img.onload = function(e) { alert("image loaded"); } img.setAttribute("src", "/static/images/bullet.gif"); Not sure what your problem is (I find it unlikely that your onload handler is sending unsolicited commercial email) but note that your image onload handler is attempting to append the image to the body, and it's entirely possible that the body doesn't exist in the DOM at that point in time; that would give you an error. If you mean that it's giving an error message in the JS Console, posting that message might help. Cheers, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ From flavio at economisa.com.br Thu Sep 21 14:51:54 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Thu, 21 Sep 2006 16:51:54 -0300 Subject: [Javascript] Image PreLoad In-Reply-To: <966B5EA7-F419-4DF0-BB12-722EB2E45741@nickfitz.co.uk> References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> <4512DC21.50908@economisa.com.br> <966B5EA7-F419-4DF0-BB12-722EB2E45741@nickfitz.co.uk> Message-ID: <4512ED5A.1020906@economisa.com.br> heheheh, no, it's not sending mail =) There's no error message, and the "document.body" already exists. What I believe to be the problem is that I set a call to "document.body.appendChild(img)" (...) =============== img.onload = function(e) { alert("image loaded"); document.body.appendChild(this); } =============== (..) inside the "onload handler" and, on Mozilla it seems to call the "onload" when a object is appended, making my code get locked in an infinite loop. Can you test this code for us on your Firefoxes and Safari? (It doesnt loop in IE6 Windows) Nick Fitzsimons escreveu: > On 21 Sep 2006, at 19:38, Fl?vio Gomes wrote: > >> myPreload = document.createElement("img"); >> >> //myPreload.src = "http://www.google.com/intl/en/images/logo.gif"; >> >> // A couple of large images to test >> >> //myPreload.src = "http://www.plantzafrica.com/vegetation/vegimages/ >> funderstoreyzululand.jpg"; >> >> myPreload.src = "http://www.forestserviceni.gov.uk/our_forests/ >> forests/east%20district/images/belvoir/belvoir_1.jpg"; >> >> myPreload.onload = function() { alert(" I'm Loaded! >> "); //Fires on onload >> document.body.appendChild (myPreload); >> //Append the image to the document >> alert(" Here I am! "); >> //Says "Hello"? =) >> this.onload = ""; >> // BUG FIX HERE >> }; >> >> >> >> People please test this code for me? >> On my Mozilla the onload event kept on spamming all the time... > > > Hi, > > The following worked for me on Safari 2.0.4, Firefox 1.5 Mac, Opera 9 > Mac, Firefox 1.5 Windows, and IE 6 Windows: > > var img = document.createElement("img"); > img.onerror = function(e) { > // this event on the img element is apparently not supported by > Safari > alert("error loading image"); > } > img.onload = function(e) { > alert("image loaded"); > } > img.setAttribute("src", "/static/images/bullet.gif"); > > Not sure what your problem is (I find it unlikely that your onload > handler is sending unsolicited commercial email) but note that your > image onload handler is attempting to append the image to the body, > and it's entirely possible that the body doesn't exist in the DOM at > that point in time; that would give you an error. If you mean that > it's giving an error message in the JS Console, posting that message > might help. > > Cheers, > > Nick. -- Flavio Gomes flavio at economisa.com.br From nick at nickfitz.co.uk Thu Sep 21 15:23:05 2006 From: nick at nickfitz.co.uk (Nick Fitzsimons) Date: Thu, 21 Sep 2006 21:23:05 +0100 Subject: [Javascript] Image PreLoad In-Reply-To: <4512ED5A.1020906@economisa.com.br> References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> <4512DC21.50908@economisa.com.br> <966B5EA7-F419-4DF0-BB12-722EB2E45741@nickfitz.co.uk> <4512ED5A.1020906@economisa.com.br> Message-ID: On 21 Sep 2006, at 20:51, Fl?vio Gomes wrote: > heheheh, no, it's not sending mail =) > > There's no error message, and the "document.body" already exists. > > What I believe to be the problem is that I set a call to > "document.body.appendChild(img)" (...) > > =============== > img.onload = function(e) { > alert("image loaded"); > document.body.appendChild(this); > } > =============== > > (..) > inside the "onload handler" and, on Mozilla it seems to call the > "onload" when a object is appended, making my code get locked in an > infinite loop. > > Can you test this code for us on your Firefoxes and Safari? (It > doesnt loop in IE6 Windows) > Hi, I don't have any problem even when appending the image to the body on Firefox 1.5.0.7 (Mac & Win), Opera 9 (Mac), Safari 2.0.4, or IE 6; I've put up a test page at: with the script that's working for me in the page. It's not much (if at all) different to your code. What version of Firefox are you having problems with? If it's the same one, I'm not sure why it's not working. One minor difference between my and your code is that you set the "src" property before attaching the onload handler, but when I changed my code to do the same, it still worked. So that's one potential issue you don't have to check :-) Oh, and it doesn't seem to make a difference if one uses my approach of setting the image source using setAttribute, or yours of setting the src property directly - still works. Cheers, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ From patcito at gmail.com Thu Sep 21 21:39:23 2006 From: patcito at gmail.com (Patrick Aljord) Date: Fri, 22 Sep 2006 03:39:23 +0100 Subject: [Javascript] need help for my swaping function Message-ID: <6b6419750609211939j7c481fdhe5e87e84ae223aab@mail.gmail.com> i wrote a function that adds tags to a textbox and remove them if there are in already like in delicious: function addTag(ele) { var thisTag = ele.innerHTML; var taglist = document.getElementById('tags'); var tags = taglist.value.split(', '); // if the tag is in the list, we remove it if (tags.contains(thisTag)) { tags = tags.remove(thisTag); ele.className = 'unselected'; // else we add it } else { tags.splice(0, 0, thisTag); ele.className = 'selected'; } taglist.value = tags.join(', '); document.getElementById('tags').focus(); } Array.prototype.contains = function (ele) { for (var i = 0; i < this.length; i++) { if (this[i] == ele) { return true; } } return false; }; Array.prototype.remove = function (ele) { var arr = new Array(); var count = 0; for (var i = 0; i < this.length; i++) { if (this[i] != ele) { arr[count] = this[i]; count++; } } return arr; }; and in my code I have:


    tag1 tag2 it works well, when I click on a tag it gets displayed in the textbox and when I click on the tag again it removes it correctly. But if I write a tag in the textbox that also feature in one of the tag span, then if I click in the tag span it won't remove it. I will add it again to the list as if the script didn't check tags added by hand. Any idea what's wrong? thanx in advance Pat From asureshkumar_1983 at yahoo.co.in Fri Sep 22 03:25:12 2006 From: asureshkumar_1983 at yahoo.co.in (suresh kumar) Date: Fri, 22 Sep 2006 09:25:12 +0100 (BST) Subject: [Javascript] how to disable right click mouse option in IE browser Message-ID: <20060922082512.37913.qmail@web8612.mail.in.yahoo.com> Hi, Is there any javascript function available to prevent user from clicking the right mouse button in the IE browser display area .because there is a view source option available when user click the right mouse button in browser display area. i want to prevent user from viewing the source code A.suresh --------------------------------- Find out what India is talking about on - Yahoo! Answers India Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at dorward.me.uk Fri Sep 22 03:50:55 2006 From: david at dorward.me.uk (David Dorward) Date: Fri, 22 Sep 2006 09:50:55 +0100 Subject: [Javascript] how to disable right click mouse option in IE browser In-Reply-To: <20060922082512.37913.qmail@web8612.mail.in.yahoo.com> References: <20060922082512.37913.qmail@web8612.mail.in.yahoo.com> Message-ID: <20060922085055.GB3000@us-lot.org> On Fri, Sep 22, 2006 at 09:25:12AM +0100, suresh kumar wrote: > Is there any javascript function available to prevent user from > clicking the right mouse button in the IE browser display area .because > there is a view source option available when user click the right mouse > button in browser display area. i want to prevent user from viewing the > source code You can't prevent the user from viewing the source code, you can only irritate them. See http://dorward.me.uk/www/hide/ ... which I should update to mention the fairly common "Allow JS to run, but don't let it mess with my context menu" options that browsers generally come with these days. -- David Dorward http://dorward.me.uk From riegel at clearimageonline.com Fri Sep 22 06:55:37 2006 From: riegel at clearimageonline.com (Terry Riegel) Date: Fri, 22 Sep 2006 07:55:37 -0400 Subject: [Javascript] Image PreLoad In-Reply-To: References: <56296F1A-1467-42E5-80DA-C2B05EC52A91@lptmc.jussieu.fr> <4512B470.3070105@economisa.com.br> <4512DC21.50908@economisa.com.br> <966B5EA7-F419-4DF0-BB12-722EB2E45741@nickfitz.co.uk> <4512ED5A.1020906@economisa.com.br> Message-ID: <0EEE4CDC-662F-4B76-961A-0F30EE036EA7@clearimageonline.com> Hello, Thanks for the answer. I found that in my application the onload event would misfire periodically, so I set up a little bit more code to make sure I knew the image was in. I found IsImageOk and modified it for my needs. When calling loadImage() it will see if the image is already loaded and display. If it isn't loaded it will load it with an onload event firing the display routine. If the onload event doesn't trigger them it will check back every second to try again. Any suggestions on improving this code would be helpful. Terry function IsImageOk(img) { if (!img.complete) { return false; } if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; } return true; } function loadImage(src) { var i=new Image; i.src=src; i.onload=showit; if (IsImageOk(i)) { showit(); } else { spinneron(); setTimeout('loadImage(src)',1000); } } On Sep 21, 2006, at 4:23 PM, Nick Fitzsimons wrote: > On 21 Sep 2006, at 20:51, Fl?vio Gomes wrote: > >> heheheh, no, it's not sending mail =) >> >> There's no error message, and the "document.body" already exists. >> >> What I believe to be the problem is that I set a call to >> "document.body.appendChild(img)" (...) >> >> =============== >> img.onload = function(e) { >> alert("image loaded"); >> document.body.appendChild(this); >> } >> =============== >> >> (..) >> inside the "onload handler" and, on Mozilla it seems to call the >> "onload" when a object is appended, making my code get locked in >> an infinite loop. >> >> Can you test this code for us on your Firefoxes and Safari? (It >> doesnt loop in IE6 Windows) >> > > Hi, > > I don't have any problem even when appending the image to the body > on Firefox 1.5.0.7 (Mac & Win), Opera 9 (Mac), Safari 2.0.4, or IE > 6; I've put up a test page at: > > > > with the script that's working for me in the page. It's not much > (if at all) different to your code. What version of Firefox are you > having problems with? If it's the same one, I'm not sure why it's > not working. > > One minor difference between my and your code is that you set the > "src" property before attaching the onload handler, but when I > changed my code to do the same, it still worked. So that's one > potential issue you don't have to check :-) Oh, and it doesn't seem > to make a difference if one uses my approach of setting the image > source using setAttribute, or yours of setting the src property > directly - still works. > > Cheers, > > Nick. > -- > Nick Fitzsimons > http://www.nickfitz.co.uk/ > > > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From wdlists at triche-osborne.com Fri Sep 22 10:06:24 2006 From: wdlists at triche-osborne.com (Triche Osborne) Date: Fri, 22 Sep 2006 10:06:24 -0500 Subject: [Javascript] Organizing onload events Message-ID: <4513FBF0.3030408@triche-osborne.com> The more I use unobtrusive methods, the longer my external onload script gets and the more often I run into situations where I have events that are only required for given pages. Is it standard practice to include all of these event attachments in a single file which is loaded for every page, regardless of whether the page needs the script (and the overhead), or do you tailor the scripts to a given page or section? Also, what of scripts that require arguments for the functions called by the attached events? Example: an optional popup function that requires the pathname, width and height of the image it is to display. Since I'm often creating these pages via PHP and want to keep them as simple as possible for the end-user to style, I've thought of assigning a class="popup" and coded ID to the thumbnail (something like id="img12345678-300-400"). This seems awkward, but so does writing out an associative multi-dim array for the page's affected elements. (Since the event may or may not need to be attached, depending on whether there is an enlargement available, I can't just grab all IMG children within the item DIVs.) Am I overlooking a really obvious, simple solution? Triche Osborne From skyscanner at eircom.net Fri Sep 22 10:33:04 2006 From: skyscanner at eircom.net (SkyScanner) Date: Fri, 22 Sep 2006 16:33:04 +0100 Subject: [Javascript] How to decode obfuscated Javscript Message-ID: <028d01c6de5c$7f0aa780$1600000a@IBMT43> Does anyone know how to decode obfuscated Javscript, or view a script 'as the browser is seeing it' ??? I have a page here: http://www.mapability.com/obfuscator.htm (please view the source) that has an obfuscated script in it. I need very much to view this script and be able to change it. Unfortunately, the site that I obtained the script from, many years ago, (StickySauce) has closed down and disappeared, so I have no way of contacting the original author. Can anyone help? Tim ,was in Ireland, now in England www.mapability.com/travel PS - if YOU need a good obfuscator, I would recommend this page. Save it to your computer and use it off-line. From dnunes at gmail.com Fri Sep 22 10:49:29 2006 From: dnunes at gmail.com (diego nunes) Date: Fri, 22 Sep 2006 12:49:29 -0300 Subject: [Javascript] How to decode obfuscated Javscript In-Reply-To: <028d01c6de5c$7f0aa780$1600000a@IBMT43> References: <028d01c6de5c$7f0aa780$1600000a@IBMT43> Message-ID: <14f57d420609220849y4f0f89cbs518e2abb0922c749@mail.gmail.com> That's the code: function EnCrypt() { var form = document.encrypt; var code1 = escape(form.oldcode.value); var code2=""; var thelength = code1.length; for (i=0;i References: <028d01c6de5c$7f0aa780$1600000a@IBMT43> Message-ID: <45140637.9080308@economisa.com.br> Check the last variable "V1Aqapkrv" function EnCrypt() { var form = document.encrypt; var code1 = escape(form.oldcode.value); var code2=""; var thelength = code1.length; for (i=0;i Does anyone know how to decode obfuscated Javscript, or view a script > 'as the browser is seeing it' ??? > > I have a page here: > http://www.mapability.com/obfuscator.htm > (please view the source) that has an obfuscated script in it. I need > very much to view this script and be able to change it. Unfortunately, > the site that I obtained the script from, many years ago, > (StickySauce) has closed down and disappeared, so I have no way of > contacting the original author. > > Can anyone help? > > Tim ,was in Ireland, now in England > www.mapability.com/travel > > PS - if YOU need a good obfuscator, I would recommend this page. Save > it to your computer and use it off-line. > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -- Flavio Gomes flavio at economisa.com.br From paul at juniperwebcraft.com Fri Sep 22 18:54:16 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Fri, 22 Sep 2006 16:54:16 -0700 Subject: [Javascript] How to decode obfuscated Javscript In-Reply-To: <028d01c6de5c$7f0aa780$1600000a@IBMT43> References: <028d01c6de5c$7f0aa780$1600000a@IBMT43> Message-ID: <7.0.1.0.2.20060922165234.048ebae0@juniperwebcraft.com> At 9/22/2006 08:33 AM, SkyScanner wrote: >Does anyone know how to decode obfuscated Javscript, or view a >script 'as the browser is seeing it' ??? The Firefox web developer's toolbar by chris Pederick has a 'view generated source' options. http://chrispederick.com/work/webdeveloper/ It's become an indispensible toolbox in my work. Paul From paul at juniperwebcraft.com Sat Sep 23 01:04:28 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Fri, 22 Sep 2006 23:04:28 -0700 Subject: [Javascript] Organizing onload events In-Reply-To: <4513FBF0.3030408@triche-osborne.com> References: <4513FBF0.3030408@triche-osborne.com> Message-ID: <7.0.1.0.2.20060922222538.02254220@juniperwebcraft.com> At 9/22/2006 08:06 AM, Triche Osborne wrote: >The more I use unobtrusive methods, the longer my external onload >script gets and the more often I run into situations where I have >events that are only required for given pages. Is it standard >practice to include all of these event attachments in a single file >which is loaded for every page, regardless of whether the page needs >the script (and the overhead), or do you tailor the scripts to a >given page or section? > Also, what of scripts that require arguments for the > functions called by the attached events? Example: an optional popup > function that requires the pathname, width and height of the image > it is to display. Since I'm often creating these pages via PHP and > want to keep them as simple as possible for the end-user to style, > I've thought of assigning a class="popup" and coded ID to the > thumbnail (something like id="img12345678-300-400"). > This seems awkward, but so does writing out an associative > multi-dim array for the page's affected elements. (Since the event > may or may not need to be attached, depending on whether there is > an enlargement available, I can't just grab all IMG children within > the item DIVs.) Hi Triche, This is a really great question. and I hope the responses reflect the richness of the topic. One of the cool things about javascript, like PHP and some other scripting languages, is that you can test whether a function already exists -- if (!jsDoSomething) -- and load it as needed, analagous to DLL architecture. I imagine this would only be practical when the optional functions were quite large, to justify the necessarily long time it takes to load anything of any size from an internet server, but the mechanism is there for when we need it. The primary trade-off seems to concern cache: if you can tolerate a long initial load, then the big js file is in cache and won't be loaded again (until the user clears their cache or explicitly reloads the browser content). If you break your script down into many smaller parts and load them as needed, then you distribute the response time lag more evenly over the experience of browsing the site. Which way you go on any given project will depend on a dozen variables, including your expectation of how long (for how many page-views) an average user is likely to stay and how big "big" is, even on dial-up. With regard to your suggestion of img id="img12345678-300-400" you should remain aware of the relationship between markup and behavior and of your presumed desire to separate the two. The more details you hard-code into your markup, the less separable it is from your script. I'd recommend writing generic markup with ids & classes and generic behavior in javascript, then joining them together with datasets that contain the specifics. That way you are much more likely to be able to modify the markup or the behavior or the data without necessarily having to tweak all three at once. Project management will lighten accordingly. Regards, Paul From skyscanner at eircom.net Sat Sep 23 03:40:07 2006 From: skyscanner at eircom.net (SkyScanner) Date: Sat, 23 Sep 2006 09:40:07 +0100 Subject: [Javascript] How to decode obfuscated Javscript References: <028d01c6de5c$7f0aa780$1600000a@IBMT43> <7.0.1.0.2.20060922165234.048ebae0@juniperwebcraft.com> Message-ID: <003d01c6deeb$e3bc5810$1600000a@IBMT43> Many many many thanks to Fl?vio and Diego for the code, and to Paul for explaining how its done. You guys are LIFE-SAVERS!! Tim in England, getting out his box of medals... From moseley at hank.org Sat Sep 23 08:40:05 2006 From: moseley at hank.org (Bill Moseley) Date: Sat, 23 Sep 2006 06:40:05 -0700 Subject: [Javascript] Organizing onload events In-Reply-To: <7.0.1.0.2.20060922222538.02254220@juniperwebcraft.com> References: <4513FBF0.3030408@triche-osborne.com> <7.0.1.0.2.20060922222538.02254220@juniperwebcraft.com> Message-ID: <20060923134005.GB3464@hank.org> On Fri, Sep 22, 2006 at 11:04:28PM -0700, Paul Novitski wrote: > The primary trade-off seems to concern cache: if you can tolerate a > long initial load, then the big js file is in cache and won't be > loaded again (until the user clears their cache or explicitly reloads > the browser content). If you break your script down into many > smaller parts and load them as needed, then you distribute the > response time lag more evenly over the experience of browsing the > site. Which way you go on any given project will depend on a dozen > variables, including your expectation of how long (for how many > page-views) an average user is likely to stay and how big "big" is, > even on dial-up. And make sure your web server is returning correct caching control instructions to the browser. mod_expires on Apache. I also compress the large javascript files. Used to be some debate about doing this, but it's probably a win these days. mod_deflate on Apache. -- Bill Moseley moseley at hank.org From coldfusion.developer at att.net Sat Sep 23 13:51:44 2006 From: coldfusion.developer at att.net (coldfusion.developer at att.net) Date: Sat, 23 Sep 2006 18:51:44 +0000 Subject: [Javascript] Share Code with other Web site Message-ID: <092320061851.19804.4515823F000EBAEB00004D5C21602813029D0A9F01040A900A0BD20201079C9A000B04010C@att.net> I'm a newbie to Javasript and was looking for an example of how to use JavaScript to share your HTML with other Web sites. So I would want to give them a link to a javascript on my web site that they would copy and paste on their web site. I don't want these users to be able to edit the ode that this scrit displays on this web site. Much like the the way that google's ad sense works. Does anyone have any template code or web site that show an example of how to do this? The other question is, I will be dynamically generating and passing parameters into this javacode that will be just for this user. Questions? 1) Do I have to create a single javascript instance for each output or is there a way to have dynamic javascript that populates variables inside the javascript from my site as well? Thank you so muh for any direction, samples, URLs. Thanks. Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From hassan at webtuitive.com Sat Sep 23 14:18:51 2006 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 23 Sep 2006 12:18:51 -0700 Subject: [Javascript] Share Code with other Web site In-Reply-To: <092320061851.19804.4515823F000EBAEB00004D5C21602813029D0A9F01040A900A0BD20201079C9A000B04010C@att.net> References: <092320061851.19804.4515823F000EBAEB00004D5C21602813029D0A9F01040A900A0BD20201079C9A000B04010C@att.net> Message-ID: <4515889B.7080600@webtuitive.com> coldfusion.developer at att.net wrote: > I'm a newbie to Javasript and was looking for an example of how to use > JavaScript to share your HTML with other Web sites. So I would want > to give them a link to a javascript on my web site that they would copy > and paste on their web site. Yep, that's the way it works -- you write your script and host it on Site A, Site B's owner pastes the link to it into a page, and your script is fetched by User X's browser from Site A when that page is loaded. > The other question is, I will be dynamically generating and passing > parameters > into this javacode that will be just for this user. > 1) Do I have to create a single javascript instance for each output > or is there a way to have dynamic javascript that populates variables Does JavaScript have variables? Yes. :-) Do you have any prior programming experience, and if so in what language(s)? Perhaps we can relate it to something you're already familiar with... -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com opinion: webtuitive.blogspot.com dream. code. From paul at juniperwebcraft.com Sat Sep 23 16:09:39 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Sat, 23 Sep 2006 14:09:39 -0700 Subject: [Javascript] Share Code with other Web site In-Reply-To: <092320061851.19804.4515823F000EBAEB00004D5C21602813029D0A9 F01040A900A0BD20201079C9A000B04010C@att.net> References: <092320061851.19804.4515823F000EBAEB00004D5C21602813029D0A9F01040A900A0BD20201079C9A000B04010C@att.net> Message-ID: <7.0.1.0.2.20060923134628.021f81d8@juniperwebcraft.com> At 9/23/2006 11:51 AM, coldfusion.developer at att.net wrote: >I'm a newbie to Javasript and was looking for an example of how to use >JavaScript to share your HTML with other Web sites. So I would want >to give them a link to a javascript on my web site that they would copy >and paste on their web site. I don't want these users to be able to edit >the ode that this scrit displays on this web site. Much like the the way >that google's ad sense works. ... >The other question is, I will be dynamically generating and passing >parameters >into this javacode that will be just for this user. From your description, it sounds to me as though JavaScript by itself might not be the right choice, but instead a combination of JavaScript and a server-side scripting language such as PHP. You can't give JavaScript to someone but prevent them from editing it. You can go to a great deal of effort to obfuscate the script, but unobfuscating it is child's play and your time will be better spent on other aspects of your work. A server-side script, in contrast, can provide results to the user while remaining completely inaccessible to them as script. Using PHP, you can give someone a simple url such as http://example.com/clientcontent/?id=1123456890 which will resolve to anything you want -- an image, text, or HTML markup. An iframe or XMLHttpRequest on the client's website can then incorporate that content into their page. You might try googling XMLHttpRequest and Ajax to see JavaScript's role in such a collaboration. Regards, Paul From coldfusion.developer at att.net Sat Sep 23 19:35:15 2006 From: coldfusion.developer at att.net (coldfusion.developer at att.net) Date: Sun, 24 Sep 2006 00:35:15 +0000 Subject: [Javascript] Share Code with other Web site Message-ID: <092420060035.13478.4515D2C30007B5E1000034A621587667559D0A9F01040A900A0BD20201079C9A000B04010C@att.net> I'm a old fusion developer, if you ouldn't tell my the email address. I have a Javascript that will call a cold fusion page so I can pass dynamic variables to the path of the cfm page. However, I was just going to use the write doc Javascript, but what I have requires the Javascript on their site to all a function. I want it to be a straight reference to a .js file instead. Does anyone know of any scripts out there that would give me a base to start from? Thanks. D -------------- Original message from Paul Novitski : -------------- > At 9/23/2006 11:51 AM, coldfusion.developer at att.net wrote: > >I'm a newbie to Javasript and was looking for an example of how to use > >JavaScript to share your HTML with other Web sites. So I would want > >to give them a link to a javascript on my web site that they would copy > >and paste on their web site. I don't want these users to be able to edit > >the ode that this scrit displays on this web site. Much like the the way > >that google's ad sense works. > ... > >The other question is, I will be dynamically generating and passing > >parameters > >into this javacode that will be just for this user. > > > From your description, it sounds to me as though JavaScript by > itself might not be the right choice, but instead a combination of > JavaScript and a server-side scripting language such as PHP. > > You can't give JavaScript to someone but prevent them from editing > it. You can go to a great deal of effort to obfuscate the script, > but unobfuscating it is child's play and your time will be better > spent on other aspects of your work. A server-side script, in > contrast, can provide results to the user while remaining completely > inaccessible to them as script. > > Using PHP, you can give someone a simple url such as > http://example.com/clientcontent/?id=1123456890 which will resolve to > anything you want -- an image, text, or HTML markup. An iframe or > XMLHttpRequest on the client's website can then incorporate that > content into their page. You might try googling XMLHttpRequest and > Ajax to see JavaScript's role in such a collaboration. > > Regards, > Paul > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From hassan at webtuitive.com Sat Sep 23 20:43:39 2006 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 23 Sep 2006 18:43:39 -0700 Subject: [Javascript] Share Code with other Web site In-Reply-To: <092420060035.13478.4515D2C30007B5E1000034A621587667559D0A9F01040A900A0BD20201079C9A000B04010C@att.net> References: <092420060035.13478.4515D2C30007B5E1000034A621587667559D0A9F01040A900A0BD20201079C9A000B04010C@att.net> Message-ID: <4515E2CB.3080403@webtuitive.com> coldfusion.developer at att.net wrote: > I'm a old fusion developer, if you ouldn't tell my the email address. mmm. I've seen email addresses like fanged_god_of_wrath at foobar.com before -- maybe I should have taken those at face value, too :-) > a Javascript that will call a cold fusion page so I can pass dynamic > variables to the path of the cfm page. OK, pretty standard stuff regardless of backend language... > However, I was just going to use the write doc Javascript, but what > I have requires the Javascript on their site to all > a function. > > I want it to be a straight reference to a .js file instead. ... but that totally lost me. Your function to pass parameters to a process on your server is, I assume, already written. Whatever it does, it'll do it from the browser it's being run in, regardless of what web site the page was loaded from. Maybe you could be a bit more specific about what's not working for you? -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com opinion: webtuitive.blogspot.com dream. code. From bernu at lptmc.jussieu.fr Sun Sep 24 11:19:38 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sun, 24 Sep 2006 18:19:38 +0200 Subject: [[Javascript]] width and height of an element Message-ID: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Hi list, How can I find the width and size of an element ? Say for example I have :
    hello
    When I click on "hello" I'd like to get the width and height of this element. Bernard From leehinde at gmail.com Sun Sep 24 11:33:14 2006 From: leehinde at gmail.com (Lee Hinde) Date: Sun, 24 Sep 2006 09:33:14 -0700 Subject: [[Javascript]] width and height of an element In-Reply-To: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: On 9/24/06, Bernu Bernard wrote: > Hi list, > > How can I find the width and size of an element ? > > Say for example I have : > >
    hello
    > > When I click on "hello" I'd like to get the width and height of this > element. > > Bernard > _______________________________________________ Google is your friend. I found this: http://www.aspandjavascript.co.uk/javascript/javascript_api/get_element_width_height.asp (o, google est vous ami? :-) ) -- Mark Twain: "What gets us into trouble is not what we don't know. It's what we know for sure that just ain't so." From bernu at lptmc.jussieu.fr Sun Sep 24 11:42:38 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sun, 24 Sep 2006 18:42:38 +0200 Subject: [[Javascript]] width and height of an element In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: Thanks for your response but it does not answer my needs. The site you mentioned give a size of an element which has that size (width or height) already set. My question is what you do when the browser decides the width and size of the element. The usual need is when you precise the width and you want to find what the browser has set for the height. When you directly ask the height you get nothing (null or undefined). Bernard Le Sep 24, 2006 ? 6:33 PM, Lee Hinde a ?crit : > On 9/24/06, Bernu Bernard wrote: >> Hi list, >> >> How can I find the width and size of an element ? >> >> Say for example I have : >> >>
    hello
    >> >> When I click on "hello" I'd like to get the width and height of this >> element. >> >> Bernard >> _______________________________________________ > > > Google is your friend. I found this: > > http://www.aspandjavascript.co.uk/javascript/javascript_api/ > get_element_width_height.asp > > (o, google est vous ami? :-) ) > -- > Mark Twain: "What gets us into trouble is not what we don't know. It's > what we know for sure that just ain't so." > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From mwarden at gmail.com Sun Sep 24 11:46:58 2006 From: mwarden at gmail.com (Matt Warden) Date: Sun, 24 Sep 2006 12:46:58 -0400 Subject: [[Javascript]] width and height of an element In-Reply-To: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: On 9/24/06, Bernu Bernard wrote: > Hi list, > > How can I find the width and size of an element ? > > Say for example I have : > >
    hello
    > > When I click on "hello" I'd like to get the width and height of this > element. http://developer.yahoo.com/yui/docs/dom/YAHOO.util.Dom.html#getRegion http://developer.yahoo.com/yui/docs/dom/YAHOO.util.Region.html#bottom -- Matt Warden Cleveland, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. From bernu at lptmc.jussieu.fr Sun Sep 24 13:13:38 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sun, 24 Sep 2006 20:13:38 +0200 Subject: [[Javascript]] width and height of an element [solved] In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: Thank you Matt, This are very good links. I finally found what I was looking for since a long time. I'm on MacOSX and tested IE (5.2.3) , Safari (2.04) , Opera (9.0.1) , Firefox (1.5.0.7) , Camino (1.0.3), All work with elem.clientHeight PS : the on line lib is false for Safari (it says e.innerHeight should work for Safari, but it does not - at least on version 2) Le Sep 24, 2006 ? 6:46 PM, Matt Warden a ?crit : > On 9/24/06, Bernu Bernard wrote: >> Hi list, >> >> How can I find the width and size of an element ? >> >> Say for example I have : >> >>
    hello
    >> >> When I click on "hello" I'd like to get the width and height of this >> element. > > http://developer.yahoo.com/yui/docs/dom/YAHOO.util.Dom.html#getRegion > http://developer.yahoo.com/yui/docs/dom/YAHOO.util.Region.html#bottom > > -- > Matt Warden > Cleveland, OH, USA > http://mattwarden.com > > > This email proudly and graciously contributes to entropy. > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From leehinde at gmail.com Sun Sep 24 13:41:40 2006 From: leehinde at gmail.com (Lee Hinde) Date: Sun, 24 Sep 2006 11:41:40 -0700 Subject: [[Javascript]] width and height of an element In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: I'm glad you found what you are after, but, since I'm touchy, I wanted to show you how I tested before I sent that link: untitled
    Here I am.
    That gives me an answer.... On 9/24/06, Bernu Bernard wrote: > Thanks for your response but it does not answer my needs. > > The site you mentioned give a size of an element which has that size > (width or height) already set. > > My question is what you do when the browser decides the width and > size of the element. > The usual need is when you precise the width and you want to find > what the browser has set for the height. > > When you directly ask the height you get nothing (null or undefined). > > Bernard > Le Sep 24, 2006 ? 6:33 PM, Lee Hinde a ?crit : > > > On 9/24/06, Bernu Bernard wrote: > >> Hi list, > >> > >> How can I find the width and size of an element ? > >> > >> Say for example I have : > >> > >>
    hello
    > >> > >> When I click on "hello" I'd like to get the width and height of this > >> element. > >> > >> Bernard > >> _______________________________________________ > > > > > > Google is your friend. I found this: > > > > http://www.aspandjavascript.co.uk/javascript/javascript_api/ > > get_element_width_height.asp > > > > (o, google est vous ami? :-) ) > > -- > > Mark Twain: "What gets us into trouble is not what we don't know. It's > > what we know for sure that just ain't so." > > _______________________________________________ > > Javascript mailing list > > Javascript at LaTech.edu > > https://lists.LaTech.edu/mailman/listinfo/javascript > > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > -- Mark Twain: "What gets us into trouble is not what we don't know. It's what we know for sure that just ain't so." From paul at juniperwebcraft.com Sun Sep 24 15:24:59 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Sun, 24 Sep 2006 13:24:59 -0700 Subject: [[Javascript]] width and height of an element In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: <7.0.1.0.2.20060924131848.023fd6f0@juniperwebcraft.com> At 9/24/2006 09:42 AM, Bernu Bernard wrote: >My question is what you do when the browser decides the width and >size of the element. >The usual need is when you precise the width and you want to find >what the browser has set for the height. > >When you directly ask the height you get nothing (null or undefined). I have found Peter-Paul Koch to be a source of reliable low-level JavaScript functions: http://www.quirksmode.org/ His JavaScript section: http://www.quirksmode.org/js/contents.html Element dimensions: http://www.quirksmode.org/js/elementdimensions.html Regards, Paul PS: I see that PPK has redesigned his site! From bernu at lptmc.jussieu.fr Sun Sep 24 15:34:43 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sun, 24 Sep 2006 22:34:43 +0200 Subject: [[Javascript]] width and height of an element In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: <1E8BA478-7C52-4C2F-99B6-543D008E2E3E@lptmc.jussieu.fr> You are perfectly right. My mistake was to test item.style["offsetHeight"] instead of item.offsetHeight. I just verified that offsetHeight works as well as clientHeight on all browsers I have (under MacOSX) Bernard Le Sep 24, 2006 ? 8:41 PM, Lee Hinde a ?crit : > I'm glad you found what you are after, but, since I'm touchy, I wanted > to show you how I tested before I sent that link: > > > > > > untitled > > > > > > >
    > Here I am. >
    > > > > > That gives me an answer.... > > > > On 9/24/06, Bernu Bernard wrote: >> Thanks for your response but it does not answer my needs. >> >> The site you mentioned give a size of an element which has that size >> (width or height) already set. >> >> My question is what you do when the browser decides the width and >> size of the element. >> The usual need is when you precise the width and you want to find >> what the browser has set for the height. >> >> When you directly ask the height you get nothing (null or undefined). >> >> Bernard >> Le Sep 24, 2006 ? 6:33 PM, Lee Hinde a ?crit : >> >> > On 9/24/06, Bernu Bernard wrote: >> >> Hi list, >> >> >> >> How can I find the width and size of an element ? >> >> >> >> Say for example I have : >> >> >> >>
    hello
    >> >> >> >> When I click on "hello" I'd like to get the width and height of >> this >> >> element. >> >> >> >> Bernard >> >> _______________________________________________ >> > >> > >> > Google is your friend. I found this: >> > >> > http://www.aspandjavascript.co.uk/javascript/javascript_api/ >> > get_element_width_height.asp >> > >> > (o, google est vous ami? :-) ) >> > -- >> > Mark Twain: "What gets us into trouble is not what we don't >> know. It's >> > what we know for sure that just ain't so." >> > _______________________________________________ >> > Javascript mailing list >> > Javascript at LaTech.edu >> > https://lists.LaTech.edu/mailman/listinfo/javascript >> >> _______________________________________________ >> Javascript mailing list >> Javascript at LaTech.edu >> https://lists.LaTech.edu/mailman/listinfo/javascript >> > > > -- > Mark Twain: "What gets us into trouble is not what we don't know. It's > what we know for sure that just ain't so." > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From bernu at lptmc.jussieu.fr Sun Sep 24 15:44:38 2006 From: bernu at lptmc.jussieu.fr (Bernu Bernard) Date: Sun, 24 Sep 2006 22:44:38 +0200 Subject: [[Javascript]] width and height of an element In-Reply-To: <7.0.1.0.2.20060924131848.023fd6f0@juniperwebcraft.com> References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> <7.0.1.0.2.20060924131848.023fd6f0@juniperwebcraft.com> Message-ID: <6B3362FB-BFD4-449A-BA68-C43D306A5FC8@lptmc.jussieu.fr> Le Sep 24, 2006 ? 10:24 PM, Paul Novitski a ?crit : > At 9/24/2006 09:42 AM, Bernu Bernard wrote: >> My question is what you do when the browser decides the width and >> size of the element. >> The usual need is when you precise the width and you want to find >> what the browser has set for the height. >> >> When you directly ask the height you get nothing (null or undefined). > > > I have found Peter-Paul Koch to be a source of reliable low-level > JavaScript functions: > http://www.quirksmode.org/ > > His JavaScript section: > http://www.quirksmode.org/js/contents.html > > Element dimensions: > http://www.quirksmode.org/js/elementdimensions.html > > > Regards, > Paul > > PS: I see that PPK has redesigned his site! This is indeed a very useful site. Thanks. Regards, Bernard > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript From john at jwarner.com Sun Sep 24 16:19:09 2006 From: john at jwarner.com (John Warner) Date: Sun, 24 Sep 2006 17:19:09 -0400 Subject: [[Javascript]] width and height of an element In-Reply-To: <7.0.1.0.2.20060924131848.023fd6f0@juniperwebcraft.com> Message-ID: <093101c6e01f$14a9d400$6b01a8c0@earth> Paul, thanks for the link, I'm always on the look out for good finds like this. John Warner > -----Original Message----- > From: javascript-bounces at LaTech.edu > [mailto:javascript-bounces at LaTech.edu] On Behalf Of Paul Novitski > Sent: Sunday, September 24, 2006 4:25 PM > To: javascript at LaTech.edu > Subject: Re: [[Javascript]] width and height of an element > > > At 9/24/2006 09:42 AM, Bernu Bernard wrote: > >My question is what you do when the browser decides the > width and size > >of the element. The usual need is when you precise the width and you > >want to find what the browser has set for the height. > > > >When you directly ask the height you get nothing (null or undefined). > > > I have found Peter-Paul Koch to be a source of reliable low-level > JavaScript functions: > http://www.quirksmode.org/ > > His JavaScript section: http://www.quirksmode.org/js/contents.html > > Element dimensions: > http://www.quirksmode.org/js/elementdimensions.html > > > > Regards, > Paul > > PS: I see that PPK has redesigned his site! From mwarden at gmail.com Mon Sep 25 02:54:52 2006 From: mwarden at gmail.com (Matt Warden) Date: Mon, 25 Sep 2006 03:54:52 -0400 Subject: [[Javascript]] width and height of an element [solved] In-Reply-To: References: <89A0D7B2-B18F-45FA-A7F3-93A2384AA472@lptmc.jussieu.fr> Message-ID: On 9/24/06, Bernu Bernard wrote: > Thank you Matt, > This are very good links. I finally found what I was looking for > since a long time. > I'm on MacOSX and tested IE (5.2.3) , Safari (2.04) , Opera > (9.0.1) , Firefox (1.5.0.7) , Camino (1.0.3), > > All work with > elem.clientHeight > > PS : the on line lib is false for Safari (it says e.innerHeight > should work for Safari, but it does not - at least on version 2) YUI uses offsetHeight. YAHOO.util.Region.getRegion = function(el) { var p = YAHOO.util.Dom.getXY(el); var t = p[1]; var r = p[0] + el.offsetWidth; var b = p[1] + el.offsetHeight; var l = p[0]; return new YAHOO.util.Region(t, r, b, l); }; YUI works with the following browser grading: http://developer.yahoo.com/yui/articles/gbs/gbs_browser-chart.html http://developer.yahoo.com/yui/articles/gbs/gbs.html Thats the nice thing about using a platform like YUI -- you really don't have to worry as much about this sort of thing, as long as your standards align with theirs. -- Matt Warden Cleveland, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. From petersen at ma.medias.ne.jp Thu Sep 28 01:06:13 2006 From: petersen at ma.medias.ne.jp (Scott Petersen) Date: Thu, 28 Sep 2006 15:06:13 +0900 Subject: [Javascript] Hiding email addresses In-Reply-To: Message-ID: In order to hide email addresses from spam address collectors, I have come up with the following:

    Send Mail

    This should send mail to BigBoy at someDomain.com. My question is: Does this really slow down the address collectors? My thinking is it would since the two parts of the address are not contiguous, though would not be hard to recover with a half-way sophisticated robot-collector. Thank you. From david at dorward.me.uk Thu Sep 28 02:15:38 2006 From: david at dorward.me.uk (David Dorward) Date: Thu, 28 Sep 2006 08:15:38 +0100 Subject: [Javascript] Hiding email addresses In-Reply-To: References: Message-ID: <20060928071536.GA25548@us-lot.org> On Thu, Sep 28, 2006 at 03:06:13PM +0900, Scott Petersen wrote: >

    Send Mail

    > This should send mail to BigBoy at someDomain.com. My question is: Does this > really slow down the address collectors? It probably slows down some ... but its really not hard to write a bot that can handle Javascript. I put together a proof of concept earlier this year, http://blog.dorward.me.uk/2006/02/02/spambots_that_drink_coffee.html (That won't cover your particular code, but its just a proof of concept). The code you provided would also leave users without JavaScript unable to contact you, and make it rather difficult to copy/paste the email address (e.g. for users of webmail services). -- David Dorward http://dorward.me.uk From john at jwarner.com Thu Sep 28 07:52:22 2006 From: john at jwarner.com (John Warner) Date: Thu, 28 Sep 2006 08:52:22 -0400 Subject: [Javascript] Hiding email addresses In-Reply-To: <20060928071536.GA25548@us-lot.org> Message-ID: <099301c6e2fc$f1584e10$6b01a8c0@earth> So at the bottom of this discussion, what is the consensus best way to include contact info but 'discourage' spambots? John Warner > -----Original Message----- > From: javascript-bounces at LaTech.edu > [mailto:javascript-bounces at LaTech.edu] On Behalf Of David Dorward > Sent: Thursday, September 28, 2006 3:16 AM > To: [JavaScript List] > Subject: Re: [Javascript] Hiding email addresses > > > On Thu, Sep 28, 2006 at 03:06:13PM +0900, Scott Petersen wrote: > >

    Send Mail

    > > > This should send mail to BigBoy at someDomain.com. My question > is: Does > > this really slow down the address collectors? > > It probably slows down some ... but its really not hard to > write a bot that can handle Javascript. I put together a > proof of concept earlier this year, > http://blog.dorward.me.uk/2006/02/02/spambots_that_drink_coff> ee.html > > (That won't cover your particular code, but its just a proof > of concept). > > The code you provided would also leave users without > JavaScript unable to contact you, and make it rather > difficult to copy/paste the email address (e.g. for users of > webmail services). > > -- > David Dorward http://dorward.me.uk From david at dorward.me.uk Thu Sep 28 07:53:31 2006 From: david at dorward.me.uk (David Dorward) Date: Thu, 28 Sep 2006 13:53:31 +0100 Subject: [Javascript] Hiding email addresses In-Reply-To: <099301c6e2fc$f1584e10$6b01a8c0@earth> References: <20060928071536.GA25548@us-lot.org> <099301c6e2fc$f1584e10$6b01a8c0@earth> Message-ID: <20060928125331.GH28254@us-lot.org> On Thu, Sep 28, 2006 at 08:52:22AM -0400, John Warner wrote: > So at the bottom of this discussion, what is the consensus There isn't a consensus. > best way to include contact info but 'discourage' spambots? Ignore the spambots, and have decent spamfiltering on the mailbox. -- David Dorward http://dorward.me.uk From john at jwarner.com Thu Sep 28 08:01:15 2006 From: john at jwarner.com (John Warner) Date: Thu, 28 Sep 2006 09:01:15 -0400 Subject: [Javascript] Hiding email addresses In-Reply-To: <20060928125331.GH28254@us-lot.org> Message-ID: <099701c6e2fe$2ed52910$6b01a8c0@earth> I didn't want to hear that... Thanks John Warner > -----Original Message----- > From: javascript-bounces at LaTech.edu > [mailto:javascript-bounces at LaTech.edu] On Behalf Of David Dorward > Sent: Thursday, September 28, 2006 8:54 AM > To: '[JavaScript List]' > Subject: Re: [Javascript] Hiding email addresses > > > On Thu, Sep 28, 2006 at 08:52:22AM -0400, John Warner wrote: > > So at the bottom of this discussion, what is the consensus > > There isn't a consensus. > > > best way to include contact info but 'discourage' spambots? > > Ignore the spambots, and have decent spamfiltering on the mailbox. > > -- > David Dorward http://dorward.me.uk From david at dorward.me.uk Thu Sep 28 08:06:40 2006 From: david at dorward.me.uk (David Dorward) Date: Thu, 28 Sep 2006 14:06:40 +0100 Subject: [Javascript] Hiding email addresses In-Reply-To: <099701c6e2fe$2ed52910$6b01a8c0@earth> References: <20060928125331.GH28254@us-lot.org> <099701c6e2fe$2ed52910$6b01a8c0@earth> Message-ID: <20060928130640.GI28254@us-lot.org> On Thu, Sep 28, 2006 at 09:01:15AM -0400, John Warner wrote: > I didn't want to hear that... Thanks You asked. It basically boils down to it being impossible to distinguish between a human and a bot, so any barriers you try to put up in front of bots are also going to be put up in front of (at least some) people (and probably won't stop all bots anyway). -- David Dorward http://dorward.me.uk From mdougherty at pbp.com Thu Sep 28 08:18:42 2006 From: mdougherty at pbp.com (Mike Dougherty) Date: Thu, 28 Sep 2006 09:18:42 -0400 Subject: [Javascript] Hiding email addresses In-Reply-To: <099701c6e2fe$2ed52910$6b01a8c0@earth> References: <099701c6e2fe$2ed52910$6b01a8c0@earth> Message-ID: Considering that your less-sophisticated friends are probably putting your personal email address in the "send this funny stuff to a friend" form, you really shouldn't worry about using your address in clear text on a web page. Consider making functional email addresses rather than using one address for everything. ex: use feedback at yourdomain.com and webmaster at yourdomain.com - both can be aliases for you at yourdomain.com If you own the mail server, you can probably configure it to dump 'unknown username' to a single mailbox - that lets you create new usernames for every page on your site (as nutty as that would be) - then you can set up rules to forward any given "to" address to a box you actually monitor. If these mailto links are primarily back to yourself (rather than your customers, etc) you could use "...&subject=[key:pageid]_YourSubjectHere&body=Subject must contain key to pass SPAM filter" Set your mailbox to automatically reject anything that does not have your key in the subject. Harvesters are unlikely to preserve this information when they send their email. well, that's my off-the-cuff two cents. :) On Thu, 28 Sep 2006 09:01:15 -0400 "John Warner" wrote: > I didn't want to hear that... Thanks >> -----Original Message----- >> From: javascript-bounces at LaTech.edu >> >> On Thu, Sep 28, 2006 at 08:52:22AM -0400, John Warner wrote: >> Ignore the spambots, and have decent spamfiltering on the mailbox. From javascript at webdesignofficina.com Thu Sep 28 11:39:53 2006 From: javascript at webdesignofficina.com (Guillaume) Date: Thu, 28 Sep 2006 18:39:53 +0200 Subject: [Javascript] Dom rollover Message-ID: <451BFAD9.4080405@webdesignofficina.com> Hi JS community, I'm trying to change the color of several pieces of text in tags ( h1, p and a ) contained in a div called #too when I mousover this div... A rollover basically... I thought switching node's classes contained inside #too... It doesn't work... I can change the background-color, add a colored border... But the h1, p and a tags won't change their colors... Anything obvious I'm missing below ? Here's the concerned tree inside my page:

    +Tools

    Toolbar

    Here's the Js: var oncL9 = document.getElementById('too'); oncL9.onmouseover = tooOv; function tooOv() { var el = document.getElementById('too'); if (el.hasChildNodes()) { var nodels = el.childNodes; for (var i = 0; i < nodels.length; i++) { nodels[i].className = 'tooOve'; }; }; } And here's the Css: .tooOve{ color: red;< This one doesn't work background-color: black; < This one works cursor: pointer; } So why can I not switch class of the child nodes inside #too to simply change the text color from grey to red ? Guillaume From dnunes at gmail.com Thu Sep 28 12:34:10 2006 From: dnunes at gmail.com (diego nunes) Date: Thu, 28 Sep 2006 14:34:10 -0300 Subject: [Javascript] Dom rollover In-Reply-To: <451BFAD9.4080405@webdesignofficina.com> References: <451BFAD9.4080405@webdesignofficina.com> Message-ID: <14f57d420609281034u5aa9d383l2abf29cb6e2bd84c@mail.gmail.com> On 9/28/06, Guillaume wrote: > function tooOv() { > var el = document.getElementById('too'); > if (el.hasChildNodes()) { > var nodels = el.childNodes; > for (var i = 0; i < nodels.length; i++) { > nodels[i].className = 'tooOve'; > }; > }; > } You could use much more CSS to achieve this, instead of complicated recursive scripts.

    mimimi

    mimim im imim i mi mi mimimi mimi mi mi

    mimim im imim i mi mi mimimi mimi mi mi

    mimim im imim i mi mi mimimi mimi mi mi

    Doesn't it works? -- diego nunes dnunes.com From wdlists at triche-osborne.com Thu Sep 28 12:38:49 2006 From: wdlists at triche-osborne.com (Triche Osborne) Date: Thu, 28 Sep 2006 12:38:49 -0500 Subject: [Javascript] Dom rollover In-Reply-To: <451BFAD9.4080405@webdesignofficina.com> References: <451BFAD9.4080405@webdesignofficina.com> Message-ID: <451C08A9.7040504@triche-osborne.com> Guillaume wrote: > Hi JS community, > > I'm trying to change the color of several pieces of text in tags ( h1, p > and a ) contained in a div called #too when I mousover this div... > A rollover basically... > I thought switching node's classes contained inside #too... > It doesn't work... I can change the background-color, add a colored > border... But the h1, p and a tags won't change their colors... > Not sure of your purpose here, so if this is out of line, I apologize: Is there a reason not to use CSS's natural inheritance instead of trying to change each child node? HTML:

    Title

    This is my paragraph.

    CSS: div.off { border: 0; color: #000; } div.on { border: 2px solid #f00; } div.on h1 { color: #f00; } div.on span { color: #00f; } JS: Attach the mouseover/mouseout events to the parent DIV and CSS takes care of the rest. Triche > Anything obvious I'm missing below ? > > Here's the concerned tree inside my page: > >
    >

    > +Tools >

    >

    > > Toolbar > >

    >
    > > Here's the Js: > > var oncL9 = document.getElementById('too'); > > oncL9.onmouseover = tooOv; > > function tooOv() { > > var el = document.getElementById('too'); > > if (el.hasChildNodes()) { > > var nodels = el.childNodes; > > for (var i = 0; i < nodels.length; i++) { > > nodels[i].className = 'tooOve'; > > > }; > > }; > > } > > > > > And here's the Css: > > .tooOve{ > > color: red;< This one doesn't work > > background-color: black; < This one works > > cursor: pointer; > > } > > > > So why can I not switch class of the child nodes inside #too to simply > change the text color from grey to red ? > > Guillaume > _______________________________________________ > Javascript mailing list > Javascript at LaTech.edu > https://lists.LaTech.edu/mailman/listinfo/javascript > > From paul at juniperwebcraft.com Thu Sep 28 13:26:58 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Thu, 28 Sep 2006 11:26:58 -0700 Subject: [Javascript] Dom rollover In-Reply-To: <451BFAD9.4080405@webdesignofficina.com> References: <451BFAD9.4080405@webdesignofficina.com> Message-ID: <7.0.1.0.2.20060928112441.02323098@juniperwebcraft.com> At 9/28/2006 09:39 AM, Guillaume wrote: >I'm trying to change the color of several pieces of text in tags ( >h1, p and a ) contained in a div called #too when I mousover this div... >A rollover basically... >I thought switching node's classes contained inside #too... >It doesn't work... I can change the background-color, add a colored >border... But the h1, p and a tags won't change their colors... In addition to what others have said: If the child elements don't change their color with their parent's color, my guess is that you've assigned them a background color in your stylesheet. Background color is one of those properties that naturally "inherits" from parent to child. Remove those child properties or assign them {background-color: inherit;}. Regards, Paul From davidh126 at writeme.com Thu Sep 28 20:30:08 2006 From: davidh126 at writeme.com (David Hucklesby) Date: Thu, 28 Sep 2006 18:30:08 -0700 Subject: [Javascript] Dom rollover In-Reply-To: <7.0.1.0.2.20060928112441.02323098@juniperwebcraft.com> Message-ID: <200692818308.666407@DAVIDS> >?At 9/28/2006 09:39 AM, Guillaume wrote: >>?I'm trying to change the color of several pieces of text in tags >>?( h1, p and a ) contained in a div called #too when I mousover >>?this div... A rollover basically... >>?I thought switching node's classes contained inside #too... It >>?doesn't work... I can change the background-color, add a colored >>?border... But the h1, p and a tags won't change their colors... > On Thu, 28 Sep 2006 11:26:58 -0700, Paul Novitski responded: > >?In addition to what others have said: > >?If the child elements don't change their color with their parent's >?color, my guess is that you've assigned them a background color in >?your stylesheet. ?Background color is one of those properties that >?naturally "inherits" from parent to child. ?Remove those child >?properties or assign them {background-color: inherit;}. > Umm. Not so. The background-color property is one of the few that do *not* inherit. If unassigned, background-color defaults to transparent, allowing background colors and images set on enclosing elements to show through. Think about it. A background image set on the BODY appears in all places unless another background overlays it. I see where you got the idea from though. It does *appear* to inherit from enclosing elements. The color property does inherit. But Guillaume may be having problems with specificity. In your style sheet, Guillaume, if you are using ".tooOve" as your selector, try making it "#too .tooOve" instead. To preserve existing classes on those children, you may prefer to use "nodes[i].className += ' tooOve'" (notice the leading space). Cordially, David -- From paul at juniperwebcraft.com Thu Sep 28 22:15:20 2006 From: paul at juniperwebcraft.com (Paul Novitski) Date: Thu, 28 Sep 2006 20:15:20 -0700 Subject: [Javascript] Dom rollover In-Reply-To: <200692818308.666407@DAVIDS> References: <7.0.1.0.2.20060928112441.02323098@juniperwebcraft.com> <200692818308.666407@DAVIDS> Message-ID: <7.0.1.0.2.20060928201041.025193a8@juniperwebcraft.com> At 9/28/2006 06:30 PM, David Hucklesby wrote: >Umm. Not so. The background-color property is one of the few that >do *not* inherit. If unassigned, background-color defaults to >transparent, allowing background colors and images set on enclosing >elements to show through. Think about it. A background image set on >the BODY appears in all places unless another background overlays it. You are so right: CSS 2.1 Specification 14 Colors and Backgrounds 14.2 The background http://www.w3.org/TR/CSS21/colors.html "Background properties are not inherited, but the parent box's background will shine through by default because of the initial 'transparent' value on 'background-color'." Standing corrected, Paul From BConner at huntsvilletx.gov Fri Sep 29 13:31:09 2006 From: BConner at huntsvilletx.gov (Barry Conner) Date: Fri, 29 Sep 2006 13:31:09 -0500 Subject: [Javascript] Javascript fontsize control from external page Message-ID: <9B3006CF6C51E4498BC82AEDC60ABED3F70F07@SVRMAIL.cityofhuntsville.com> QUESTION: How can an external page using Javascript be used to change font sizes on the primary page? I have a FRAMES webpage into which I've designed a control bar. This control bar appears as a "header" frame, and includes controls to modify font sizes to suit the user's preference. It works fine, except that the only font size it will change is on the control bar itself !!! I need to know how to make this Javascript act upon the primary page within my frames page. I'm appending the code from the control bar to this email. It may be pretty sloppy, but I'm a novice. Here's the code: ASBUILT OPERATIONS
    View Control:
    From Liam.Rice at autodata.net Fri Sep 29 13:40:13 2006 From: Liam.Rice at autodata.net (Liam Rice) Date: Fri, 29 Sep 2006 14:40:13 -0400 Subject: [Javascript] Load order for .js files & iframes Message-ID: <07472729F6E15741B5DB63A38733D989021B7104@exchange.london.autodata.net> Hey there, I've got a couple of external .js file that are loaded by a page. The first is loaded in the head of the file. The second is loaded in the body via a separate file in a hidden iframe. But it seems that the one in the iframe is loading before the one in the head. Anybody have any ideas why this would be happening? Everything seems to work when loaded, it just leaves the user with the notion that something is broken, because the browser says there's issues (a variable is not defined). Liam David Edwin Rice liam.rice at autodata.net This message has originated from Autodata Solutions. The attached material is the Confidential and Proprietary Information of Autodata Solutions. The email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Autodata system administrator at Administrator at autodata.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From moseley at hank.org Fri Sep 29 14:16:00 2006 From: moseley at hank.org (Bill Moseley) Date: Fri, 29 Sep 2006 12:16:00 -0700 Subject: [Javascript] Image dissolve? Message-ID: <20060929191600.GA30817@hank.org> Anyone know of code to cycle through images with a dissolve? I'm trying to see if there's a better way than using flash -- which is currently about a 400Kb download and is just used to display three images that cycle in a banner. I suspect flash is a bit less platform dependent, but that's a big download just for a few images. -- Bill Moseley moseley at hank.org From flavio at economisa.com.br Fri Sep 29 14:30:48 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Fri, 29 Sep 2006 16:30:48 -0300 Subject: [Javascript] Image dissolve? In-Reply-To: <20060929191600.GA30817@hank.org> References: <20060929191600.GA30817@hank.org> Message-ID: <451D7468.4070409@economisa.com.br> document.getElementsByName("mySpecialImage") This code returns an array with all elements that have this same name. That's a starting point. =) Bill Moseley escreveu: >Anyone know of code to cycle through images with a dissolve? > >I'm trying to see if there's a better way than using flash -- which is >currently about a 400Kb download and is just used to display three >images that cycle in a banner. > >I suspect flash is a bit less platform dependent, but that's a big >download just for a few images. > > > > -- Flavio Gomes flavio at economisa.com.br From peter at brunone.com Fri Sep 29 14:39:35 2006 From: peter at brunone.com (Peter Brunone) Date: Fri, 29 Sep 2006 12:39:35 -0700 Subject: [Javascript] Image dissolve? Message-ID: <9226d65f74084d7786f20c6a56e58d3d@brunone.com> I recently used a Flash slideshow app (from Xtivity or something like that) to display about nine images in a rotating, fading fashion. Aside from being dead easy to use, it had the helpful habit of producing a flash file which merely loaded the images as needed rather than storing them in some wacky format. Just a thought... Peter From: Bill Moseley Sent: Friday, September 29, 2006 12:19 PM To: javascript at LaTech.edu Subject: [Javascript] Image dissolve? Anyone know of code to cycle through images with a dissolve? I'm trying to see if there's a better way than using flash -- which is currently about a 400Kb download and is just used to display three images that cycle in a banner. I suspect flash is a bit less platform dependent, but that's a big download just for a few images. -- Bill Moseley moseley at hank.org _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgchipman at gmail.com Fri Sep 29 14:46:12 2006 From: sgchipman at gmail.com (Steven Chipman) Date: Fri, 29 Sep 2006 15:46:12 -0400 Subject: [Javascript] Image dissolve? In-Reply-To: <20060929191600.GA30817@hank.org> References: <20060929191600.GA30817@hank.org> Message-ID: <26ca962b0609291246j592496dap77391d697b983a72@mail.gmail.com> On 9/29/06, Bill Moseley wrote: > Anyone know of code to cycle through images with a dissolve? > Not sure what sort of dissolve your looking for exactly, but I've written a few image transition experiments that do various disolvey/fadey things. Some urls for your perusal: http://slayeroffice.com/code/slide_show4/ http://slayeroffice.com/code/slide_show5/ http://slayeroffice.com/code/slide_show6/ http://slayeroffice.com/code/imageCrossFade/xfade2.html Probably not exactly what you are looking for, but may give you some ideas. -- steve http://slayeroffice.com From admin at chrome.me.uk Fri Sep 29 14:51:55 2006 From: admin at chrome.me.uk (Chrome) Date: Fri, 29 Sep 2006 20:51:55 +0100 Subject: [Javascript] Image dissolve? In-Reply-To: <20060929191600.GA30817@hank.org> References: <20060929191600.GA30817@hank.org> Message-ID: <011c01c6e400$b7e92280$27bb6780$@me.uk> Not a dissolve in the traditional sense but how about stacking the images one on top of the other and having only the top one visible... Then fire a timer to initiate a 'dissolve' which simply hooks into the Opacity styling gradually fading the top image out and the underlying image in? It's a simplistic model and maybe not suitable but something to consider? Oh as for grabbing the image objects; put them in a DIV and grab the DIV by its ID (e.g. MyDIV) then do a var mydiv = MyDIV.getElementsByTagName('image') Cheers Dan -- http://chrome.me.uk >-----Original Message----- >From: javascript-bounces at LaTech.edu [mailto:javascript- >bounces at LaTech.edu] On Behalf Of Bill Moseley >Sent: 29 September 2006 20:16 >To: javascript at LaTech.edu >Subject: [Javascript] Image dissolve? > >Anyone know of code to cycle through images with a dissolve? > >I'm trying to see if there's a better way than using flash -- which is >currently about a 400Kb download and is just used to display three >images that cycle in a banner. > >I suspect flash is a bit less platform dependent, but that's a big >download just for a few images. > > >-- >Bill Moseley >moseley at hank.org > >_______________________________________________ >Javascript mailing list >Javascript at LaTech.edu >https://lists.LaTech.edu/mailman/listinfo/javascript > >__________ NOD32 1.1783 (20060929) Information __________ > >This message was checked by NOD32 antivirus system. >http://www.eset.com From moseley at hank.org Fri Sep 29 15:02:00 2006 From: moseley at hank.org (Bill Moseley) Date: Fri, 29 Sep 2006 13:02:00 -0700 Subject: [Javascript] Image dissolve? In-Reply-To: <26ca962b0609291246j592496dap77391d697b983a72@mail.gmail.com> References: <20060929191600.GA30817@hank.org> <26ca962b0609291246j592496dap77391d697b983a72@mail.gmail.com> Message-ID: <20060929200200.GC31263@hank.org> On Fri, Sep 29, 2006 at 03:46:12PM -0400, Steven Chipman wrote: > http://slayeroffice.com/code/slide_show4/ > http://slayeroffice.com/code/slide_show5/ > http://slayeroffice.com/code/slide_show6/ > http://slayeroffice.com/code/imageCrossFade/xfade2.html > > Probably not exactly what you are looking for, but may give you some ideas. Well, that is what I'm looking for. ;) Any idea what browsers do and don't support that? -- Bill Moseley moseley at hank.org From peter at brunone.com Fri Sep 29 15:16:31 2006 From: peter at brunone.com (Peter Brunone) Date: Fri, 29 Sep 2006 13:16:31 -0700 Subject: [Javascript] Image dissolve? Message-ID: <892c4905b78f4d788c80e1afc015e353@brunone.com> Follow-up: this is what I used. http://www.tivity.com/xtivity/xtivity.html ...and the swf file for the nine-image slideshow was about 7k. Took me about a minute to create the thing after opening the app. Peter From: Bill Moseley moseley at hank.org On Fri, Sep 29, 2006 at 03:46:12PM -0400, Steven Chipman wrote: > http://slayeroffice.com/code/slide_show4/ > http://slayeroffice.com/code/slide_show5/ > http://slayeroffice.com/code/slide_show6/ > http://slayeroffice.com/code/imageCrossFade/xfade2.html > > Probably not exactly what you are looking for, but may give you some ideas. Well, that is what I'm looking for. ;) Any idea what browsers do and don't support that? -- Bill Moseley moseley at hank.org _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From newtquest at yahoo.co.uk Fri Sep 29 15:26:59 2006 From: newtquest at yahoo.co.uk (Gaz Newt) Date: Fri, 29 Sep 2006 21:26:59 +0100 (BST) Subject: [Javascript] Programmatically invoke the file browse dialog of input type=file Message-ID: <20060929202659.4541.qmail@web86909.mail.ukl.yahoo.com> I want to have a separate button which invokes the "browse" button on an input type=file. In internet explorer the following code works ok, in firefox nothing happens. All I do is call click() for the input control. Do you know how to make this work in firefox? Thanks Test

    --------------------------------- The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. -------------- next part -------------- An HTML attachment was scrubbed... URL: From flavio at economisa.com.br Fri Sep 29 16:33:45 2006 From: flavio at economisa.com.br (=?ISO-8859-1?Q?Fl=E1vio_Gomes?=) Date: Fri, 29 Sep 2006 18:33:45 -0300 Subject: [Javascript] Programmatically invoke the file browse dialog of input type=file In-Reply-To: <20060929202659.4541.qmail@web86909.mail.ukl.yahoo.com> References: <20060929202659.4541.qmail@web86909.mail.ukl.yahoo.com> Message-ID: <451D9139.7040206@economisa.com.br> I don't believe it's possible or easy to do. If you check GMail on Firefox you'll see they use the standard "input file". Gaz Newt escreveu: > I want to have a separate button which invokes the "browse" button on > an input type=file. In internet explorer the following code works ok, > in firefox nothing happens. > > All I do is call click() for the input control. > > Do you know how to make this work in firefox? > > Thanks > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > > Test > > > > > > >
    > >
    > >
    > > > > > ------------------------------------------------------------------------ > The all-new Yahoo! Mail > > goes wherever you go - free your email address from your Internet > provider. > >------------------------------------------------------------------------ > >_______________________________________________ >Javascript mailing list >Javascript at LaTech.edu >https://lists.LaTech.edu/mailman/listinfo/javascript > > -- Flavio Gomes flavio at economisa.com.br From sgchipman at gmail.com Fri Sep 29 17:30:47 2006 From: sgchipman at gmail.com (Steven Chipman) Date: Fri, 29 Sep 2006 18:30:47 -0400 Subject: [Javascript] Image dissolve? In-Reply-To: <20060929200200.GC31263@hank.org> References: <20060929191600.GA30817@hank.org> <26ca962b0609291246j592496dap77391d697b983a72@mail.gmail.com> <20060929200200.GC31263@hank.org> Message-ID: <26ca962b0609291530h61088601ha6e7b6658466e4c4@mail.gmail.com> On 9/29/06, Bill Moseley wrote: > > Well, that is what I'm looking for. ;) Any idea what browsers do and > don't support that? > They work in all modern, standards compliant browsers (MSIE 6, FF 1.x, Safari 2.x, etc) that I've tested in - browsers that don't support the required gadgetry degrade, for example, versions of Opera that don't support opacity, just flip through images in a couple of them. -- steve http://slayeroffice.com From newtquest at yahoo.co.uk Sat Sep 30 08:28:52 2006 From: newtquest at yahoo.co.uk (Gaz Newt) Date: Sat, 30 Sep 2006 14:28:52 +0100 (BST) Subject: [Javascript] Programmatically invoke the file browse dialog of input type=file In-Reply-To: <451D9139.7040206@economisa.com.br> Message-ID: <20060930132852.23531.qmail@web86902.mail.ukl.yahoo.com> Ok thanks. I didn't fancy doing a browser sniff to serve different behaviour so I do the .click() and if the page hasn't lost focus within 50ms (indicating that the file dialog has appeared) I show the iframe with the "Browse" button on it. Works great! Fl?vio Gomes wrote: I don't believe it's possible or easy to do. If you check GMail on Firefox you'll see they use the standard "input file". Gaz Newt escreveu: > I want to have a separate button which invokes the "browse" button on > an input type=file. In internet explorer the following code works ok, > in firefox nothing happens. > > All I do is call click() for the input control. > > Do you know how to make this work in firefox? > > Thanks > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > Test> > > > function test() > { > var oTest = document.getElementById( "mytest"); > oTest.click(); > } > > > > > > > [input] > > [input] > > > > > > ------------------------------------------------------------------------ > The all-new Yahoo! Mail > > goes wherever you go - free your email address from your Internet > provider. > >------------------------------------------------------------------------ > >_______________________________________________ >Javascript mailing list >Javascript at LaTech.edu >https://lists.LaTech.edu/mailman/listinfo/javascript > > -- Flavio Gomes flavio at economisa.com.br _______________________________________________ Javascript mailing list Javascript at LaTech.edu https://lists.LaTech.edu/mailman/listinfo/javascript --------------------------------- To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. -------------- next part -------------- An HTML attachment was scrubbed... URL: