Moinsen.
Kenne mich mit java nicht so gut aus.
Habe eine Cookie Funktion in javascript die ich aber auf (AN/ON) haben möchte beim body onload
wie ist dies zu machen?
danke für jede hilfe?
Oder wie kann ich direkt ein cookie im browser schreiben php/html/javascript bei Onload?
Code
- <script>
- function swap_auto_play()
- {
- if($.cookie("auto_play_playlist")=="true")
- {
- $.cookie("auto_play_playlist","false",{path:"/"});
- window.location = document.location;
- $('#ap_status').html("off");
- }else
- {
- $.cookie("auto_play_playlist","true",{path:"/"});
- window.location = document.location;
- $('#ap_status').html("on");
- }
- }
- </script>
- <a href="javascript:void(0)" onclick="swap_auto_play()">Auto Play is <span id="ap_status">{if $smarty.cookies.auto_play_playlist!="true"}off{else}on{/if}</span></a>