FF + JavaScript Save Web Page Button

FF + JavaScript Save Web Page Button
G1
  • Rejestracja:ponad 20 lat
  • Ostatnio:około 14 lat
0

to jest kod działający pod IE źródło http://www.designerwiz.com/24fun/utilsave/utilsave.html

Kopiuj
function doSaveAs(){
	if (document.execCommand){
		document.execCommand("SaveAs")
	}
	else {
		alert("Save-feature available only in Internet Exlorer 5.x.")
	}
}
</script>

Jak zrobić coś takiego żeby działało na firefox??

RO
  • Rejestracja:ponad 21 lat
  • Ostatnio:prawie 7 lat
  • Postów:162
0

Nie tak samo dzialajac ale uzyskujac taki sam efekt mozesz stworzyc guzik, ktory po nacisnieciu wywoluje skrypt np w php wysylajacy aktualna strone z naglowkiem do zapisu.

Kopiuj
     header("Content-type: text/html");
     header('Content-Disposition: attachment; filename="' . "plik_strony.html" . '"');
     echo "zawartosc strony";
Demonical Monk
  • Rejestracja:ponad 17 lat
  • Ostatnio:12 miesięcy
0

Zamiast ECHO można też walnąć tak:

Kopiuj
header("Content-type: text/html");
header('Content-Disposition: attachment; filename="plik_strony.html"');
readfile('strona.html');

Women were the reason I became a monk - and, ah, the reason I switched back...

Zarejestruj się i dołącz do największej społeczności programistów w Polsce.

Otrzymaj wsparcie, dziel się wiedzą i rozwijaj swoje umiejętności z najlepszymi.