Prev: Javascript Concatenator - has bugs
Next: Purchase Xanax without a prescription. Order Xanax 1 day delivery. Buy cod day next Xanax. Xanax overnight without prescription.
From: laredotornado on 11 Apr 2010 11:15 Hi, Curious if there is a javascript solution to this. I have a URL in the form of http://www.mydomain.com/user/zzz which ultimately loads an index page with the contents <html> <script type="Text/javascript"> location.replace("login.php"); </script> </html> However, this redirects to the URL http://www.mydomain.com/user/login.php and I want to redirect to the URL http://www.mydomain.com/user/zzz/login.php. How would I rewrite my JS code to force the redirection I'm thinking of? Thanks, - Dave
From: Sean Kinsey on 11 Apr 2010 11:20 On Apr 11, 5:15 pm, laredotornado <laredotorn...(a)zipmail.com> wrote: > Hi, > > Curious if there is a javascript solution to this. I have a URL in > the form of > > http://www.mydomain.com/user/zzz > > which ultimately loads an index page with the contents > > <html> > <script type="Text/javascript"> > location.replace("login.php"); > </script> > </html> > > However, this redirects to the URL > > http://www.mydomain.com/user/login.phpand I want to redirect to the > URL > > http://www.mydomain.com/user/zzz/login.php. How would I rewrite my JS > code to force the redirection I'm thinking of? Thanks, - Dave Take a look at the location object; https://developer.mozilla.org/en/DOM/window.location Using location.href you can use the following location.replace(location.href + "/login.php);
From: laredotornado on 11 Apr 2010 12:30
On Apr 11, 10:20 am, Sean Kinsey <okin...(a)gmail.com> wrote: > On Apr 11, 5:15 pm, laredotornado <laredotorn...(a)zipmail.com> wrote: > > > > > > > Hi, > > > Curious if there is a javascript solution to this. I have a URL in > > the form of > > >http://www.mydomain.com/user/zzz > > > which ultimately loads an index page with the contents > > > <html> > > <script type="Text/javascript"> > > location.replace("login.php"); > > </script> > > </html> > > > However, this redirects to the URL > > >http://www.mydomain.com/user/login.phpandI want to redirect to the > > URL > > >http://www.mydomain.com/user/zzz/login.php. How would I rewrite my JS > > code to force the redirection I'm thinking of? Thanks, - Dave > > Take a look at the location object;https://developer.mozilla.org/en/DOM/window.location > Using location.href you can use the following > location.replace(location.href + "/login.php);- Hide quoted text - > > - Show quoted text - Perfect! To be precise, the exact line is ... location.replace(location.href + "/login.php"); - Dave |