ugrás a tartalomhoz

Nem frissül a tartalom

lacy · 2007. Okt. 25. (Cs), 20.07
Jó estét!:)

Lenne egy kis problémám...A főoldalról egy window.location.href-el eldobom a usert egy aloldalra. Onnan egy kis idő után megint javascript window.location.href-el visszadobom a főoldalra, ám ilyenkor a főoldal nem frissül, ugyanazt a tartalmat mutatja, mint a legelső oldalletöltéskor. Hogy tudnám rábeszélni, hogy töltse újra a lapot és ne nekem kelljen a frissítésre menni?

Előre is köszönöm!
 
1

location.replace

s_volenszki · 2007. Okt. 25. (Cs), 23.26
Én ha js-el navigáltatok mindíg ezt használom: window.location.replace('ahovamegyunk.php');

s_volenszki
2

köszönöm

lacy · 2007. Okt. 25. (Cs), 23.49
Köszönöm, igazad van!

The JavaScript location object has a replace method that will replace the current URL in the browser's history with a new URL (the one you are redirecting to).

// The second argument set to true will replace the current URL
// in the browser history with the new URL you are redirecting to
window.location.replace("my_new_page.htm",true);