Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
JavaScript i cookie

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 25.08.2006 23:06    Post subject: JavaScript i cookie Add user to your forum ignore list Reply with quote

Kako u javi postaviti cookie?
Je li moguce postaviti normalan head tag stranice i onda sa javom posaviti cookie jer znam da se sa PHP- om to ne moze...
A head tah stranice mora biit prisutan..
Molim vas za sto brzu pomoc...
Hvala unaprijed

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 25.08.2006 23:36    Post subject: Add user to your forum ignore list Reply with quote

Da pojasnim, radi se o slijedecoj skripti:

Code:
<script language="JavaScript">
   var broj;

   function test()
   { if (broj>6) broj=1;
     if (broj<1) broj=1;
     document['slika'].src ="headers/"+broj+".jpg";
     broj=broj+1;
   }
broj=1;
setInterval("test()", 15000);
  </script>


a html:
Code:
<IMG alt="header" src="url slike(nije vazno"  border=0 name="slika">


i sad bi tu trebao staviti naredbu (u funkciju test) da stavlja cookie imena 'headerzup' i da vrijednost cookija bude varijabla broj...
I ako je moguce, da se ne brise zatvaranjem browsera nego da traje npr. 60 dana...
puno trazim, a?

Hvala unaprijed...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 26.08.2006 09:49    Post subject: Add user to your forum ignore list Reply with quote

Oce ko odgovorit???

Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 26.08.2006 10:19    Post subject: Add user to your forum ignore list Reply with quote

ajd probaj objasnit što želiš postići, a ne kako to želiš. ono... na hrvatskom

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 26.08.2006 11:10    Post subject: Add user to your forum ignore list Reply with quote

Ovako, zelim postaviti cookie pomocu jave...
Jedino to...

Samo ne znam jel moguce sa javom postaviti cookie, a da head tag stranice (Title, Encoding) bude normalan...
Jer sa PHP- om nisam uspio napraviti da postavim cookie i da head stranice bude normalan...


Hvala unaprijed i nadam se da ste razumjeli...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 26.08.2006 12:20    Post subject: Add user to your forum ignore list Reply with quote

Nema veze...
Rjesio sam to sa PHP- om...
Hvala svejedno...

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
vedran



Joined: 08 Sep 2003
Posts: 458

PostPosted: 26.08.2006 15:31    Post subject: Add user to your forum ignore list Reply with quote

evo i js funkcija za spremanje kukija
Code:
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 27.08.2006 16:22    Post subject: Add user to your forum ignore list Reply with quote

Hvala Vedrane, al dovoljan mi je PHP....
A i vicniji sam s njim.... Cool Cool

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
tubak



Joined: 14 Mar 2005
Posts: 133
Location: Istra

PostPosted: 27.08.2006 21:51    Post subject: Add user to your forum ignore list Reply with quote

Ja radim u ASP-u, ali princip je isti i za PHP.

Dakle preko COM+ komponente (PicPreviewer) ocitam visinu i sirinu slike, te ako sirina (ili visina) prelazi 640 px onda proporcionalno prilagodim dimenzije na tu velicinu i kreiram thumbnail (opet od izvorne slike preko komponente i on the fly), a zatim u linku na taj thumbnail imam javascript code tipa

window.open('pokazisliku.php?imeslike=nekaslika.jpg','slike','visina=<?php echo(visina) ?>,sirina==<?php echo(sirina) ?>,...');

A na stranici pokazisliku.php ucitam imeslike iz quesrystringa (eventualno i putanju do slike uz ime) i stavim onClick event na tu sliku window.close().

Meni ovo OK pase jer klijent uploada samo jednu sliku (original) i ne mora znati nista o risajzanju slika (iako bi to bilo dobrodoslo, ali ne zivimo u idealnom svijetu), niti ne mora kreirati thumbnailove, a zatvaranje prozora sa prikazom slike ne moze biti jednostavnije.

Znam da sam mogao automatski smanjiti sliku na zeljenu dimenziju i prilikom uploada, ali u mom konkretnom slucaju sam uz prikaz slike u popupu (veliku do 640px) morao imati i opciju download full size image!
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 29.08.2006 11:20    Post subject: Add user to your forum ignore list Reply with quote

JavaScript i Java nisu isto Mad ne zovi JS Javom Confused
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 29.08.2006 12:32    Post subject: Add user to your forum ignore list Reply with quote

Znam da to nije isto, al eto omaklo mi se...
Dobro znam razlike tako da nemas brige...
Mislim da bi trebali objasnit razliku izmedju jave i javascripta da novaci to ne mjesaju pa da se negdje gadno ne osramote...

Cool Cool

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 29.08.2006 12:51    Post subject: Add user to your forum ignore list Reply with quote

Objašnjeno je na puno mjesta na internetu...
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 29.08.2006 14:03    Post subject: Add user to your forum ignore list Reply with quote

To su dvije posve različite stvari. Nemaju nikakve sličnosti, osim imena i toga da su slični C sintaksom

JavaScript je osmišljen da (sintaksom) liči na Javu (hence the name), ali ne da bude išta slično njoj
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group