• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Window.location.replace

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
in my application on click of a hyper-link,i am redirecting the page with window.location.replace("newURL").however this works fine with some versions of ie only.ie, it works with MSIE 5.5 but not with MSIE 5.0 is there any alternative to this.
thanks in advance
-vrunda
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, the O'Reily Javascript book (the rhino one) says IE5 runs JScript5 and IE5.5 runs JScript5.5, which should be equivelent to JavaScript 1.4 and that Location.replace() exists since JavaScript 1.1
Wierd
Have you tried window.location = "http://..."; instead?
Dave.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whats even wierder is i am certain i used window.location.replace("new url") before i had IE5.5 and it worked. however i would try what david suggested. you really only need to use replace if you want to eliminate a page from window.history
 
Vrunda Joshi
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
thanks for the reply,but i have tried the window.location="http://....",but no luck.
can anybody please guide me on these lines,
"you really only need to use replace if you want to eliminate a page from window.history"
can you make it clear a bit?
thanks in advance
-vrunda
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about window.navigate(URL)?
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when you use window.location="http://....", and someone clicks the link, if they then hit the back button they return to the page they were on(the one that contains the link). with window.location.replace("new url"), if they click the link then hit back button they go not to the page they were on, but the one before the one they were on. replace means replace.
window.navigate(URL) is new to me.
what is the reason you need javascript? why not just use a plain html link?
[ May 07, 2002: Message edited by: Randall Twede ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
window.navigate() appears to be IE only. What version? Dunno. IE4+ I'm guessing.
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much.
window.navigate() worked for me. I am looking for a method like this from 3 hours and finally found here.
reply
    Bookmark Topic Watch Topic
  • New Topic