Jump to content
xisto Community

Deretto

Members
  • Content Count

    130
  • Joined

  • Last visited

1 Follower

About Deretto

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    West New York
  1. Ok, so I tried running it off my host and I'm still having problems. The cookie is being made and the value of the cookie is being stored properly but its not being read correctly on page load. I tried some more things though. On the cookie guide that was linked in the first reply, when readCookie was used there was no semicolon. It just says var x = readCookie('ppkcookie1') So I tried no semicolon and that didn't work. Seemed dumb to me but figured I'd give it a shot. I then tried changing the way index gets its integer. //var index=0; original initiation.var index;function checkCookie(){ if (readCookie('page')!=NULL) { index = readCookie('page') document.getElementById('my_image_container').setAttribute('src', images[index]); document.getElementById('my_text_container').innerHTML = story[index]; } else {//added index=0 here index=0; createCookie('page',index,365); }}window.onload=checkCookie; When I did that my next button would no longer work. So I can assume that something is going terribly wrong when reading the cookie.
  2. Well that was a dumb typo *head desks* Ok so my navigating buttons/functions are working again. Course now the cookie doesn't seem to be working as planned. I was originally hoping that in the case of: if (readCookie('page')) That it'd return null when the page is visited for the first time. Course I was thinking that null is the same as FALSE. Just to make sure though I changed the if statement to: if (readCookie('page')!=NULL) That didn't seem to help either. Quick question, I'm currently just running the html off my hard disk. Does the web page have to actually be online in order for the cookie to be made?
  3. Well, I tried it out and sadly I didn't get too far. After adding all the cookie code my functions will no longer execute. I can't really see any syntax errors or anything like that. Here's what I did. fuction checkCookie(){ if (readCookie('page')) { index = readCookie('page'); document.getElementById('my_image_container').setAttribute('src', images[index]); document.getElementById('my_text_container').innerHTML = story[index]; } else { createCookie('page',index,365); }}window.onload=checkCookie;function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;}function nextImage(){ ++index; if (index < images.length) { document.getElementById('my_image_container').setAttribute('src', images[index]); document.getElementById('my_text_container').innerHTML = story[index]; createCookie('page',index,365); } else { index = (images.length - 1); nextImage(); }}
  4. I'm helping my friend make a website for his webcomic. Currently, the pages of his comic are set to change by buttons that pro/regress through an array. What he's asking me to do is make a cookie so that it remembers the last page the person viewed. That way when the visitor returns they'll be viewing the last page they saw. Here is an example of the javascript used for the website. var images = ["images/001.jpg", "images/002.jpg"];var story = new Array();story[0] = "blah";story[1] = "more blah";var index = 0;function nextImage(){ ++index; if (index < images.length) { document.getElementById('my_image_container').setAttribute('src', images[index]); document.getElementById('my_text_container').innerHTML = story[index]; } else { index = (images.length - 1); nextImage(); }}Similar functions exist for Previous, First, and Last Please teach me how to use cookies properly. >.<;
  5. Ok, I got that to work. Code ended up looking like this function nextImage() { ++index; if (index < images.length) { document.getElementById("my_image_container").setAttribute("src", images[index]); } else { index = (images.length - 1); nextImage(); } }function previousImage() { --index; if (index > -1) { document.getElementById("my_image_container").setAttribute("src", images[index]); } else { index = 1; previousImage(); } }function firstImage() { index = 0; document.getElementById("my_image_container").setAttribute("src", images[index]); }function lastImage() { index = (images.length - 1); document.getElementById("my_image_container").setAttribute("src", images[index]); } But now I've run into another problem. I'm trying to make Text on the page change along with the image (the text goes along with the image.) I've tried using the above code and I couldn't figure it out. If I can use external text files then great! If not then I don't mind using an array of strings either. Just if someone could help me with this too. >.<;;;
  6. Ugh, for some reason my new topic won't show up -.-

    1. Show previous comments  1 more
    2. deadmad7

      deadmad7

      maybe you didn't click the post button...

    3. Baniboy

      Baniboy

      ... and maybe it was deleted

    4. anwiii

      anwiii

      maybe you just dreampt about posting and didn't actually post anything

  7. So basically I'm making a website for my friend to host his webcomic on. I've got the layout done already as I'm knowledgeable in HTLM and CSS but not javascript. What I need is a simple code that'll change the image on the page with First, Previous, Next, and Last buttons. I don't know how long this webcomic will go on for so I'd rather use a simple code to change the image rather then make a whole page for every update. With that said, a function that takes in the visitors last viewed image so that when they revist the site the see that same image would be nice. I've tried googling this and the best I can come across or scripts for slideshows which require a lot of preloading. I don't understand javascript much but I want to learn! So if the person that posts the codes can kindly explain it to me it'd be much appreciated.
  8. I'm definitely looking forward to this. I've been a die hard Pokemon fan since the original release. I'm not too obsessed about collecting them all. For the most part I just enjoy using my favorites. Really I'd just like to see a 5th generation already, or even better something with real time. That'd be cool. I just like the designs they make for them. I remember I hated the majority of the 4th gen at first glance. I soon found myself attached to Luxray and eventually the others became accepted. x3 Pokemon for life <3
  9. I prefer turn based strategies. I have to say I enjoy games such as Fire Emblem a lot more then games like Age of Empires or Starcraft. Something about having to gathering resources really REALLY bores me. Then there's rushing and all kinds of other weird rules. Turn based strategies is like another game of chess. I of course love chess so that'd explain why I really like these games.
  10. Nice job. Thanks for this info. I personally hate using proxies cause they don't always load everything and then you get pop up etc. etc. This will help avoid that stress. Thanks again!
  11. Holy crap that wasn't pleasant to look at.... Is it even still alive at this point?
  12. Secondhand lands just came out recently. That game is filled with nothing but anthropomorphic creatures and some feral ones that you can play as. It kinda plays like Runescape, not really my style. But playing as a feral wolf was rather neat.
  13. I was never really a big Halo fan, but if this is isn't going to include Mr. Mary Sue then I might give it a nice peak. I just hope the story is decent as well and that there's no lame cliffhanger without an end boss at the end. ;
  14. Trolls, stop wasting your life trying to make other people miserable online. I just don't see the point of it. The fact that most see it as a sport is sickening.Really guys, stop the hate. D:
  15. One important thing I look at when playing an MMO is the combat system. Two things I cannot stand: Standing in place and exchanging blows while casting instants whenever possible, and jumping around like a maniac spamming your strongest skill while also spamming your potions. Make sure to make your combat system to require at least some though. Even if that thought is a simple rock/paper/scissors. It's still something. Also along with allowing people to have unique avatars I'd say allow for some unique skills as well. By that I mean allow the user to have the option when he upgrades his skill to increase range, damage, or loading time, or some combinations with lesser value. It's nice to see every character customized. Well, good luck to you. <3
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.