• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

[FRAGE] Hilfe mit Cookie im Code

bifftannon

New member
Hallo zusammen,
ich habe auf meiner Seite eine Sektion die bestätigt werden muss. (Nudes - Olaf Ernst Photography). Das funktioniert auch alles. Nun möchte ich den user nich nerven und einen cookie setzen, wenn er akzeptiert hat. Der cookie soll 7 Tage gelten.
Ich habe es geschafft einen cookie zu setzen
Code:
document.cookie="olafernstphotography=NudityAccepted";
Ich bekomme es aber nicht hin zu prüfen ob er vorhanden ist und wenn ja die message box zu skippen
Jede Hilfe ist willkommen.

Danke

Code:
<!-- Content Warning -->
<style>
	.content-warning {
		position: fixed;
		z-index: 9000;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(255,255,255,1); }
	.content-warning > div {
		position: absolute;
		top: 50%;
		left: 50%;
		width: 500px;
		text-align: center;
		border: 5px solid rgba(128,0,0, 1);
		border-radius: 1px;
		padding: 20px;
		-webkit-transform: translate(-50%, -50%);
		-moz-transform: translate(-50%, -50%);
		transform: translate(-50%, -50%); }
</style>

<script>

	$(document).ready(function() {
		$('#page-nudes').append('<div class="content-warning"><div>\
			<p>While the contents of this site is of an artistic nature it does include images of the human form that should be restricted to viewing by mature individual over the age of 18. If you allowed and willing to proceed just hit Continue.</p>\
			<p><a href="#continue">Continue</a> or <a href="/">Leave</a></p>\
			</div></div>');
		$('.content-warning a[href="#continue"]').click(function(e) {
			e.preventDefault();
			$('.content-warning').remove();
			
				
		});
	});
	
</script>
 
Zurück
Oben