Jump to content

jburridge

Members
  • Posts

    13
  • Joined

  • Last visited

jburridge's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : ("; expires="+exdate.toUTCString())); document.cookie=c_name + "=" + c_value; } function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } }
  2. if (document.getElementById('myDivId') == null) { display the other div } else { don't display the other div }
  3. REALLY wish I could edit a damn post. variable='index.php?view=modify&clubId=' + clubId; return variable;
  4. my mistake didn't see the js file above. Same thing though, You are not returning any values. Try variable=window.location.href = 'index.php?view=modify&clubId=' + clubId; return variable;
  5. It's saying function undefined because all you have inside the function is "function code here", In other words...Theirs no return value.
  6. Welp, Thank you for reminding me that they are variables.. I swapped them around and also put "var" in front of them.. No more errors at all. I also changed world[0][0][0]=eventMove; to world[0][0][0]=eventMove(); But... When I move I am still not receiving any "items". I believe their is something wrong with.. movement.js //random loot function var randomLoot=loot[Math.floor(Math.random()*loot.length)]; var randomRareLoot=rareLoot[Math.floor(Math.random()*rareLoot.length)]; var randomInteger=Math.random()+11; var randomInteger2=Math.random()+11; function eventMove () { if (randomInteger==randomInteger2) { characterBackpack=characterBackpack+randomRareLoot; } else if (randomInteger==1||5||9) { characterBackpack=characterBackpack+randomLoot; } } items.js //One-Handed Weapons var infinityBlade="Infinity Blade"; // 4 dmg var crudeSword="Crude Sword"; // 2 dmg //Chest Armor var brokenArmor="Broken Armor"; // 5 health var superiorChestpiece="Superior Chestpiece"; // 10 health var loot=[]; loot[0]=crudeSword; loot[1]=brokenArmor; var rareLoot=[]; rareLoot[0]=infinityBlade; rareLoot[1]=superiorChestpiece;
  7. characterBackpackDisplay="Backpack: "+characterBackpack; characterBackpack="emptyyy"; console.log(characterBackpackDisplay); For some reason that first line messes my whole script up, When commented out everything works again. I'm assuming theirs a syntax error? Some more code may help. var randomLoot=loot[Math.floor(Math.random()*loot.length)]; var randomRareLoot=rareLoot[Math.floor(Math.random()*rareLoot.length)]; var randomInteger=Math.random()+11; var randomInteger2=Math.random()+11; function eventMove () { if (randomInteger==randomInteger2) { characterBackpack=characterBackpack+randomRareLoot; } else if (randomInteger==1||5||9) { characterBackpack=characterBackpack+randomLoot; } } Again sorry for the questions, Some things I can't really google because I don't know where I'm going wrong... I don't know why it would break part of my array either? Heres my error ReferenceError: eventMove is not defined world[0][0][0]=eventMove; ReferenceError: characterBackpackDisplay is not defined console.log(characterBackpackDisplay);
  8. I believe this may help as well items.js var loot=[]; loot[0]=crudeSword; loot[1]=brokenArmor; var rareLoot=[]; rareLoot[0]=infinityBlade; rareLoot[1]=superiorChestpiece; //One-Handed Weapons var infinityBlade="Infinity Blade"; // 4 dmg var crudeSword="Crude Sword"; // 2 dmg //Chest Armor var brokenArmor="Broken Armor"; // 5 health var superiorChestpiece="Superior Chestpiece"; // 10 health
  9. I keep receiving this error, I'm not really sure why. Any help is greatly appreciated. Also, If I don't put the random integer inside my function will it still generate new random numbers or will it only generate 1 random number and stay that way? " ReferenceError: math is not defined var randomLoot=loot[math.floor(math.random()*loot.length)]; " movement.js var randomLoot=loot[math.floor(math.random()*loot.length)]; var randomRareLoot=rareLoot[math.floor(math.random()*rareLoot.length)]; var randomInteger=math.random()+11; var randomInteger2=math.random()+11; //each new movement starts this function to find a random item function eventMove () { if (randomInteger==randomInteger2) { characterBackpack+randomRareLoot; console.log("You found a rare item!"); console.log(characterBackpack); } else if (randomInteger==1||5||9) { characterBackpack+randomLoot; console.log("You found a item!"); console.log(characterBackpack); } }
  10. Hey everyone I'm a Website Designer and would like to expand to a developer. I just recently started learning some PHP coding and I'm currently working on a login script which I'm not doing too bad at. I love coding HTML/CSS much more than designing websites so I figured development was my better option for a career. I currently go to Full Sail University, I just started, But I will be learning alot more javascript and PHP. My main question is, What exactly can I do with PHP? I know I can do simple things like login scripts and posting info to a database. But what are some more advanced things I can learn where I will excel in development when I start my first job? Thanks everyone!
  11. I'm trying to figure out what these examples of code are called? "DB()" "connect()" I don't believe they are variables because they are not defined anywhere in another part of a script. I'm also wondering if someone knows where I can find a list of all of these so I get a better understanding of all the functions of php.
  12. Ohh thank you so much! I didn't realize doing the = sign would reset the value of $c to 3. I'll have to look up the differences between what you just posted, Thank you!
  13. Why does my following code display "It worked!" in the browser? <?php $a = 6; $b = 1; $c = $a + $b; ?> <?php if ($c = 3) {echo "It worked!";} else {echo "It didn't work :(";} ?>
×
×
  • Create New...

Important Information

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.