File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Window.location.replace

 
Vrunda Joshi
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Randall Twede
Ranch Hand
Posts: 4353
2
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
What about window.navigate(URL)?
 
Randall Twede
Ranch Hand
Posts: 4353
2
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
window.navigate() appears to be IE only. What version? Dunno. IE4+ I'm guessing.
 
vijaya bacina
Ranch Hand
Posts: 155
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic