From rajarsn at gmail.com Mon Sep 1 02:55:14 2008 From: rajarsn at gmail.com (Rajaram Sahasranaman) Date: Mon, 1 Sep 2008 13:25:14 +0530 Subject: [Javascript] Need Javascript logic for going to homepage if theprevious history not available In-Reply-To: <0K6E003O1UP9COI0@mta5.srv.hcvlny.cv.net> References: <8c6efe180808291939h3be3fce4s7095c4556e4c24ce@mail.gmail.com> <0K6E003O1UP9COI0@mta5.srv.hcvlny.cv.net> Message-ID: <8c6efe180809010055s52bfa3cey12577ff987dc22bc@mail.gmail.com> Thanks. When I used Window.location.href = url after checking window.history.length=0, it worked correctly. If there is no history avaialble, the application redirects the user to the homepage. if history is available, it will execute accordingly. Thanks a lot for your reply. On Sat, Aug 30, 2008 at 4:33 PM, (Margaret) Michele Waldman < mmwaldman at optonline.net> wrote: > I'm not sure what your looking for here. > > To go to the home page use > > Window.location = url > > Michele > > -----Original Message----- > From: javascript-bounces at lists.evolt.org > [mailto:javascript-bounces at lists.evolt.org] On Behalf Of Rajaram > Sahasranaman > Sent: Friday, August 29, 2008 10:39 PM > To: javascript at lists.evolt.org > Subject: [Javascript] Need Javascript logic for going to homepage if > theprevious history not available > > > > undefined > undefined > evolt.org > > > Hi, > > In my aspx page, I have two tabs. I have written a javascript in such a way > that if the user clicks on first tab, it will go to the previous page > visited and that will be the required behaviour which is working perfectly > fine. > > Sometimes the previous history will not be available. In the sense, there > is > an option that the user can directly visit the page by making changes in > the > url without going to login and home page. In such a case, I need to show > the > user the home page. How will I do that? Can anybody provides any logic to > me > for this? > > I have used the following JS code for going to previous page. > function UltraWebTabMain_Click(oWebTab,oTab,oEvent) > { > var wTab = igtab_getTabById("ctl00_TabControl1_UltraWebTab1"); > if(wTab!=null) > { > var tab = wTab.getSelectedTab(); > if(tab!=null) > { > var tabtext = tab.getText(); > var FirstTab = 0; > if ((oTab.Key == "Search") && (tabtext != "Search")) > { > window.history.go(-1); > wTab.setSelectedIndex(FirstTab); > > } > > } > } > } > > Can I do any modification to the above JS code so that the user should be > directed to Home Page if history not present? Can anybody provide any help > please? > > Thanks > Meeram395[image: Smile] > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript > From paul at juniperwebcraft.com Mon Sep 1 09:21:25 2008 From: paul at juniperwebcraft.com (Paul Novitski) Date: Mon, 01 Sep 2008 07:21:25 -0700 Subject: [Javascript] Need Javascript logic for going to homepage if the previous history not available In-Reply-To: <23302057.1220064064035.JavaMail.root@m01> References: <23302057.1220064064035.JavaMail.root@m01> Message-ID: At 8/29/2008 07:39 PM, Rajaram Sahasranaman wrote: >In my aspx page, I have two tabs. I have written a javascript in such a way >that if the user clicks on first tab, it will go to the previous page >visited and that will be the required behaviour which is working perfectly >fine. > >Sometimes the previous history will not be available. In the sense, there is >an option that the user can directly visit the page by making changes in the >url without going to login and home page. In such a case, I need to show the >user the home page. How will I do that? Can anybody provides any logic to me >for this? if (history && history.length > 1) { sDestination = 'index.php'; } else { sDestination = 'somewhere-else.php'; } It's always helpful to consult the source: http://developer.mozilla.org/en/DOM/window.history I don't know if testing for the existence of the history object is really necessary since it appears to be created by default in current browsers, but I might toss it in just in case the executing browser doesn't support it so that "history.length > 1" doesn't crash the browser. As always, a javascript navigation system like this should be backed up by redundant or fall-back server-side navigation so that in the absence of an operational javascript interpreter the page doesn't break. Javascript is the icing, not the cake, and in my view should not be relied upon to provide core functionality for publicly-accessible pages. Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com From schneegans at internetique.com Tue Sep 9 15:56:57 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Tue, 09 Sep 2008 16:56:57 -0400 Subject: [Javascript] looping on window objects Message-ID: <48C6E319.7070903@internetique.com> Hi, If you try this code: you will get a list of all objects contained in the current window. It works fine in Opera, Mozilla, and Safari, but in Explorer 7, all functions are missing. Is there a better way to get everything in IE? Thanks. From khondoker.huq at convergys.com Tue Sep 9 15:59:31 2008 From: khondoker.huq at convergys.com (khondoker.huq at convergys.com) Date: Tue, 9 Sep 2008 16:59:31 -0400 Subject: [Javascript] Khondoker E Huq is traveling on business Message-ID: I will be out of the office starting 09/07/2008 and will not return until 09/16/2008. For emergency, I can be reached at 513-324-5010. -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From schneegans at internetique.com Tue Sep 9 15:40:26 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Tue, 09 Sep 2008 16:40:26 -0400 Subject: [Javascript] looping on window objects Message-ID: <48C6DF3A.3030403@internetique.com> Hi, If you try this code: you will get a list of all objects contained in the current window. It works fine in Opera, Mozilla, and Safari, but in Explorer 7, all functions are missing. Is there a better way to get everything in IE? Thanks. From rich06 at gmail.com Wed Sep 10 12:19:48 2008 From: rich06 at gmail.com (rich gray) Date: Wed, 10 Sep 2008 19:19:48 +0200 Subject: [Javascript] Screen width/height issue with IE7 Message-ID: <48C801B4.6060603@richgray.com> I have reset my display settings to 1280x1024 px and I have this javascript code in a body onload event: alert(screen.width+' '+screen.availWidth+' '+screen.height+' '+screen.availHeight); Firefox/Opera/Chrome all report => 1280 1280 1024 986 IE7 reports => 1024 1024 819 789 Can anyone tell me why IE7 reports different values to the other browsers? TIA rich From trojani2000 at hotmail.com Fri Sep 12 04:29:38 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Fri, 12 Sep 2008 09:29:38 +0000 Subject: [Javascript] looping on window objects In-Reply-To: <48C6DF3A.3030403@internetique.com> References: <48C6DF3A.3030403@internetique.com> Message-ID: your code sounds like an absolute nonsense to me. what do you mean by "everything"? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Date: Tue, 9 Sep 2008 16:40:26 -0400> From: schneegans at internetique.com> To: > Subject: [Javascript] looping on window objects> > Hi,> > If you try this code:> > > you will get a list of all objects contained in the current window.> It works fine in Opera, Mozilla, and Safari, but in Explorer 7, all> functions are missing.> > Is there a better way to get everything in IE?> > Thanks.> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Want to do more with Windows Live? Learn ?10 hidden secrets? from Jamie. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 From trojani2000 at hotmail.com Fri Sep 12 04:38:47 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Fri, 12 Sep 2008 09:38:47 +0000 Subject: [Javascript] Screen width/height issue with IE7 In-Reply-To: <48C801B4.6060603@richgray.com> References: <48C801B4.6060603@richgray.com> Message-ID: That's most probably because you've alerted on IE before you've moved fom 1024 to 1280. Or because you are running your IE on a fixed resolution TV instead of on your computer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Date: Wed, 10 Sep 2008 19:19:48 +0200> To: javascript at lists.evolt.org> From: rich06 at gmail.com> Subject: [Javascript] Screen width/height issue with IE7> > I have reset my display settings to 1280x1024 px and I have this > javascript code in a body onload event:> > alert(screen.width+' '+screen.availWidth+' '+screen.height+' '+screen.availHeight);> > Firefox/Opera/Chrome all report => 1280 1280 1024 986> > IE7 reports => 1024 1024 819 789> > Can anyone tell me why IE7 reports different values to the other browsers?> > TIA> rich> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ See how Windows connects the people, information, and fun that are part of your life. http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/ From rich06 at gmail.com Fri Sep 12 05:14:23 2008 From: rich06 at gmail.com (rich gray) Date: Fri, 12 Sep 2008 12:14:23 +0200 Subject: [Javascript] Screen width/height issue with IE7 In-Reply-To: References: <48C801B4.6060603@richgray.com> Message-ID: <48CA40FF.1050400@richgray.com> Troy III Ajnej wrote: > That's most probably because you've alerted on IE before you've > moved fom 1024 to 1280. Or because you are running your IE on > a fixed resolution TV instead of on your computer. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > Incorrect in both your suggestions I'm afraid. Thanks for answering nevertheless. From mmwaldman at optonline.net Fri Sep 12 05:57:28 2008 From: mmwaldman at optonline.net ((Margaret) Michele Waldman) Date: Fri, 12 Sep 2008 06:57:28 -0400 Subject: [Javascript] looping on window objects In-Reply-To: Message-ID: <0K7200CERX76IW80@mta5.srv.hcvlny.cv.net> Why would you type something like "absolute nonsense" about someone's posting? "If you don't have something nice to nice, don't say anything at all." Michele -----Original Message----- From: javascript-bounces at lists.evolt.org [mailto:javascript-bounces at lists.evolt.org] On Behalf Of Troy III Ajnej Sent: Friday, September 12, 2008 5:30 AM To: JavaScript List Subject: Re: [Javascript] looping on window objects McAfee SiteAdvisor Warning This e-mail message contains potentially unsafe links to these sites: evolt.org your code sounds like an absolute nonsense to me. what do you mean by "everything"? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Date: Tue, 9 Sep 2008 16:40:26 -0400> From: schneegans at internetique.com> To: > Subject: [Javascript] looping on window objects> > Hi,> > If you try this code:> > > you will get a list of all objects contained in the current window.> It works fine in Opera, Mozilla, and Safari, but in Explorer 7, all> functions are missing.> > Is there a better way to get everything in IE?> > Thanks.> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Want to do more with Windows Live? Learn "10 hidden secrets" from Jamie. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!55 0F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 _______________________________________________ Javascript mailing list Javascript at lists.evolt.org http://lists.evolt.org/mailman/listinfo/javascript From schneegans at internetique.com Fri Sep 12 09:29:23 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Fri, 12 Sep 2008 10:29:23 -0400 Subject: [Javascript] looping on window objects In-Reply-To: References: <48C6DF3A.3030403@internetique.com> Message-ID: <48CA7CC3.6000208@internetique.com> >>your code sounds like an absolute nonsense to me. For your education, I finally found the cause of the problem, ie: the "DontEnum bug in Internet Explorer". Google it and you will see. From scott at randomchaos.com Fri Sep 12 09:57:56 2008 From: scott at randomchaos.com (Scott Reynen) Date: Fri, 12 Sep 2008 08:57:56 -0600 Subject: [Javascript] looping on window objects In-Reply-To: <48CA7CC3.6000208@internetique.com> References: <48C6DF3A.3030403@internetique.com> <48CA7CC3.6000208@internetique.com> Message-ID: <7AD5EE14-C905-42F8-A3A9-D7039CD16932@randomchaos.com> On [Sep 12], at [ Sep 12] 8:29 , Claude Schneegans wrote: > For your education, I finally found the cause of the problem, ie: > the "DontEnum bug in Internet Explorer". Good to know. Thanks for following up on your own question, despite the less-than-helpful response from the rest of us. Peace, Scott From schneegans at internetique.com Fri Sep 12 08:59:05 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Fri, 12 Sep 2008 09:59:05 -0400 Subject: [Javascript] looping on window objects In-Reply-To: References: <48C6DF3A.3030403@internetique.com> Message-ID: <48CA75A9.2030605@internetique.com> >>your code sounds like an absolute nonsense to me. That's your problem. If you are Javascript illiterate, ask questions, don't answer ;-) This code is just exacted from a DOM browser I'm working on, a tool that lists all objects, properties and methods in the window object. It works fine in all browsers, except for IE which does not list methods. >>what do you mean by "everything"? Everything that is in an object, ie: properties, objects and methods.