Can Anyone tell me the difference between window.location.href and top.location.href ?
And also where to use which one.
And which
top object makes more sense inside frames. Inside a frame, window refers to current frame's window while top refers to the outermost window that contains the frame(s). So:
window.location.href = 'somepage.html'; means loading somepage.html inside the frame.
top.location.href = 'somepage.html'; means loading somepage.html in the main browser window.
Two other interesting objects are self and parent.