JavaScript - Currently Learning Javascript- Would Like Some Direction
Hello everyone,
I am currently going through the process of learning JavaScript and I am enjoying it. I also know enough about HTML & CSS and I am learning more and more each day. I started doing this because I figured that finding a technical co-founder is extremely hard and I have always been interested in web and app development, so why not learn... I was wonding whether someone could direct me? I want to be able to develop websites such as scan.me or gumroad.com (similar concepts). Which code stack are these websites generally made up of (e.g php, HTML CSS and java). I'm hoping to develop my own platform/concept in the future but I am just trying to get a general idea of the direction I am going down. Thanks, Paul Similar TutorialsSo should I be learning javascript, what am I going to achieve by understanding this language? My background: Designed a website for my wifes shop: http://www.eden-flowers.co.uk Enjoyed the html and css design side of things, then we decided to add a shoppping cart, to see if we could sell a few products online. Used opencart by the way, which I thought was a good free product and reasonably easy to implement. Having looked deeper into the opencart noticed that it used PHP, so I'm thinking I would like to understand this better. And here I am now trying to understand Javascript purely because I use w3schools alot for reference and their next logical step seemed to be Javascript. I'm rambling, but if you care to respond to this very open question, then pls feel free to voice your opinion/suggestions. Code: <HTML> <HEAD> <SCRIPT TYPE="text/javascript"> //Define Functions function student(name,age,mother) { this.name = name; this.age = age; this.mother = mother; this.displayProfile = displayProfile; } function grade(math,english,science) { this.math = math; this.english = english; this.science = science; } function displayProfile() { document.writeln("Name: " + this.name + "); document.writeln("Age: " + this.age + "); document.writeln("Mother's name: " + this.mother + "); document.writeln("Math Grade: " + this.grade.math + "); document.writeln("English Grade: " + this.grade.english + "); document.writeln("Science Grade: " + this.grade.science + "); } </SCRIPT> </HEAD> <BODY> <SCRIPT TYPE="text/javascript"> { student1 = new student("John",18,"Diane"); johngrade = new grade(100,80,90); student1.displayProfile(); } </SCRIPT> </BODY> </HTML> Alright, I am learning javascript and in the middle of experimenting with functions, I don't see why this does not work? In order to learn "cool" javascript such as rollovers that you find on websites today; what would any of you guys reccomend me doing. I want to learn how to make my webpage interactive and i know what i want to do; i just dont know how to do it any suggestions are welcome; thank you Hi, I'm in the process of learning JavaScript. I picked up a "JavaScript for dummies" book at the library and it wasn't going too well. It was poorly written and made it difficult to understand things in the later chapter. What is the best online resource to learning JavaScript? Preferrably one that is good at explaining format ( I often find myself wondering if certain aspects in my script need ()'s or a "=" sign). For example, HTML has tags and that is what forms the mark up. I know JavaScript has multiple aspects (functions, objects), but I want an online resourcethat properly explains the format of these aspects. Thank you Hello all. I have been taking a JavaScript course on Udemy that while has been a very good course as far as I can tell, it has been short on practical exercises. Lots of examples, lots of showing different concepts and methods, etc, just short on the reinforcing and confidence building exercises. Thus, the point to my post here. I wish there were some kind of web developing club here locally but alas if you don't hunt, fish, drink or chew tobacco you are kind of left out, LOL. Well its not that bad, I make fun of it, but sometimes it seems so. At any rate, I'm looking for some kind of resource or something I can participate in that will help me use what I am learning and help me build some experience, etc. I want to get past the 'noob' stage as quickly as I can and as far as I know the quickest way to do that is to start coding even if its really simple stuff and working to more complicated coding. So, does anyone know of such resources? Thanks in advance for your time and help. Hi, as the title states, I'm trying to learn some basic javascript, more particularly, jQuery. I HATE having to "allow" active content to run on my IE browser. Is there a way to allow active content permanantly? Instead of having to click allow each time I refresh or reload my test pages? Also, IE keeps freezing or crashing when I run pages with scripts on them. Is this just my browser? or something to do with the active content permissions? Trying to google my questions, but no luck yet. Hi, So I have absolutely no experience or any skill in coding, so that's why I'm here. At the moment I just want to develop a program or a command string (Probably the wrong term) that let's say can open a program e.g Google chrome then type in my username then tab then my password. I.E I run this program and it opens my gmail account (Note I would do this without gmail's function of auto login.) Is javascript the right coding language to use for this sought of thing? Hello I need to do a portfolio of paintings and i found a site similar of what i have in mind. The site is http://www.pikaboo.be/ It's great because its using javascript only. I just don't know how to start my reserach for that transitions and moving objects and that stuff Anyone can give me a few tips on how to start? I have been looking at jquery and mootools it does some stuff taht it's on this site but the movement of objects and the way as they appear on the screen one by one and all that pretty stuff i have no idea how to search. Anyone can help me on where to start and how to do something like this? THank you Hi im wanting to know how does the computer know whos scored more in a game? Thanks, Paul I am well versed in ActionScript and I have done a lot of this already in As3.0 using XML Node Object. However my client wants this application to be more friendly with iphones/ipads. So we are going to have to restart this and go with Javascript which we know very little about. Basically the internet application is going to be a 'Build your own Itinerary' for a huge rock event, where we have to sort each band selected by the user based on [Date:4th or 5th of July] and [Time Playing]. Those are the only two nodes we need to check, the [date] is obviously going to split it into two groups, and the [Time] is when the band is playing in that group and there will need to be an if/then to check for conflicts. other nodes like [Name] would be used to just add each of the bands selected to that list with .append() I guess. And [Stage] is a somewhat irrelevant node stored and displayed with each item. So. In the professional opinion of those on this board... Where is a good place for a group of 'AS3.0 wise guy hacks' to start cracking at this with JavaScript? What would you suggest for rookies like us making an emergency jump to HTML/Javascript? Thanks so much in advance for the assistance. hello, i have a question about changing the selected text direction using javascript . i had searched about it , but no result i found that execCommand('BlockDirRTL', false, null); execCommand('DirLTR'); execCommand('BlockDirLTR', false, null); execCommand('DirRTL'); unavailable till now , but it's executed for other controls (align left , paste , cut , .......) any recourses or help plz thanks in advance . Someone please point me in the right direction. Basically what i'm trying to do is, Post up a nice image map up top of a page with several diff images (all same dimensions), and when the user clicks on one of the images, it loads down in a section below, without reloading the page. I have drawn a small diagram to show you guys what i'm talking about. So far, all I've found, are scripts that use some sort of lightbox that covers the entire page. I would like to try to stay away from flash if I can. The main browser, does'nt necessarily have to be one big image with a map, but it would make it look so much better if it looked matched the games menu. I'm trying to replicate a stats game menu, inside my webpage, so ppl can browse just like they do in game. Example: What I'm trying to replicate: When a weapon on this menu is clicked, it loads up on the right, and gives a brief description. I"m just trying to replicate the functionality of this menu really. So are there any kind of scripts out there that already exist, where I could accomplish this? or how would i go about this. just need someone to point me in the right direction. Thanks a million I am using the jquery megamenu from the javascriptkit.com site, for multiple buttons, and I am having an issue where one menu on the right hand side of the page wants to start the menu at the left end of the button, heading right (which is the default), and ends up forcing a 3 column menu into a 2 column one when the resolution is set to 1024 wide, because it would disappear off the page otherwise. I want instead for that one menu to END at the right hand side of the button so that the 3 columns remain intact. I do not know enough about javascript to totally follow the logic of the code and my attempts to fix this issue have produced mixed results. Any one any suggstions? [CODE] alignmenu:function($, e, megamenu_pos){ var megamenu=this.megamenus[megamenu_pos] var $anchor=megamenu.$anchorobj var $menu=megamenu.$menuobj var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu //var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight var menutop=megamenu.offsety+megamenu.anchorheight //get y coord of menu $menu.css({left:menuleft+"px", top:menutop+"px"}) this.$shimobj.css({width:megamenu.actualwidth+"px", height:megamenu.actualheight+"px", left:menuleft+"px", top:menutop+"px", display:"block"}) }, [CODE] Hi everyone, I'm curious if this is something simple. I'm working on a wordpress site using a plugin that is based off of the code from javascript kit called "highlighter scroller script". The plugin js is almost identical: http://javascriptkit.com/script/cut57.shtml What is causing it to wipe from left to right? I'm racking my brains trying to figure it out (and googling unsuccessfully it seems). All I'm trying to do is make it wipe instead from right to left. I'm sure it's something simple, but I don't know which variable to change. Can anyone point me in the right direction? THANKS! I'm developing a simple game that involves a system of interconnected nodes with unidirectional travel between nodes (similar to the circulation system!). The goal of the game is to get from a starting node to an ending node, which can be a variable number of nodes away. The program picks a random starting point, then randomly chooses one of its connecting nodes (cNodes) and pushes it onto a pathArray. A cNode is randomly chosen from this new node and it is pushed onto the pathArray. This continues for a designated number of turns, thus generating a pathArray (invisible to the player). The last element in the pathArray is the endNode and the goal of the puzzle. At each node the player is given two options of travel (though there may be more than two ways to go). One of these options MUST be the correct way if the player has not deviated from the path up until that point. If the player has deviated, this option can be any cNode. The other node is any cNode that does not lead to the endNode. The following code contains a simplified list of nodes that represents the content in my game. The function, however, is taken word for word. In this snippet, the pathArray & startNode have already been generated and I am trying to resolve how to assign "nodeChoice" as either the correct direction of travel (for a player on the correct path) or any random cNode (for a player who has deviated from the path). Keep in mind that the pathArray and cNodes lengths can be any size. Code: <script> //NODES: var nodeA = {name:"A"}; var nodeB = {name:"B"}; var nodeC = {name:"C"}; var nodeD = {name:"D"}; var nodeE = {name:"E"}; var nodeF = {name:"F"}; var nodeG = {name:"G"}; var nodeH = {name:"H"}; var nodeI = {name:"I"}; var nodeJ = {name:"J"}; var nodeK = {name:"K"}; //An array of all nodes in the system: var systemArray = [nodeA, nodeB, nodeC, nodeD, nodeE, nodeF, nodeG, nodeH, nodeI, nodeJ, nodeK]; //Connecting Nodes (cNodes): //(uni-directional, but cyclical) nodeA.cNodes = [nodeB, nodeC]; nodeB.cNodes = [nodeD, nodeE, nodeF]; nodeC.cNodes = [nodeF, nodeG]; nodeD.cNodes = [nodeI, nodeH]; nodeE.cNodes = [nodeJ]; nodeF.cNodes = [nodeK]; nodeG.cNodes = [nodeK]; nodeJ.cNodes = [nodeA]; nodeK.cNodes = [nodeA]; nodeI.cNodes = [nodeA]; nodeH.cNodes = [nodeA]; //The path chosen (generated from code not included here) var pathArray = [nodeA, nodeB, nodeE, nodeJ]; //nodeChoice will represent a cNode from any given node var nodeChoice; //chooseNode is supposed to assign nodeChoice the next element in pathArray if the player on on the right path (if at nodeB, nodeChoice = nodeE). //However, if the user has taken a different path, its cNodes will not be in pathArray in which case a random cNode is assigned to nodeChoice function chooseNode(_node) { //check each cNode to see if any are in pathArray for (var j = 0; j < _node.cNodes.length; j++) { //if a cNode is in pathArray, then we know to assign it nodeChoice... if (_node.cNodes[j] in pathArray) { nodeChoice = _node.cNodes[j]; console.log("choiceNode CORRECT: " + nodeChoice.name); //(for debugging purposes only) } //...otherwise don't do anything in this forLoop/ifStatement }; //if by this point nodeChoice is still undefined, meaning none of the current node's cNodes are in pathArray, assign it any one of its cNodes. if (nodeChoice == undefined) { nodeChoice = _node.cNodes[Math.floor(Math.random()* _node.cNodes.length)]; console.log("choiceNode INCORRECT: " + nodeChoice.name);//(for debugging purposes only) }; }; //Runtime: chooseNode(nodeB); //Result should be only nodeE.name since nodeD is not in the pathArray... console.log(nodeChoice.name); </script> ...however, nodeChoice is assigned either D, E or F randomly and we are given the troubleshooting statement "choiceNode INCORRECT: D (or) E (or) F", indicating that the if-in statement is always ignored. I know that the if-in statement doesn't work but am not sure how else to write it so that each cNode is compared the each element in pathArray, both of which can be of variable lengths... I am currently trying to learn the <form> object. Now I have done some things within <form> like setting up text fields with submit buttons, etc.. But now on this part of the course it is showing properties I think, within the decleration of the <form> such as shown below Code: <FORM METHOD="POST" ACTION="/cgi-bin/correct.pl" onSubmit="return false;"> Could someone explain to me what that ACTION="/cgi-bin/corrct.pl" is for along with the onSubmit="return false;" ?? I'd like an explanation of the properties of <form> if you could please. Im trying to learn how to code but i'm not getting it can anyone help me with java? <3 -ButterFly<3 Ok guys, i am starting from he http://www.javascriptkit.com/javatutors/primer5.shtml Code: <script type="text/javascript"> var example example=document.lastModified document.write("This page was last modified: "+example) </script> I am having trouble understanding an actual situation which may require the above coding, can anyone give an example please? Hi there! I'm obviously new to the forums here and don't really know if this is the right place to get help. I've made a small game in an HTA file using JavaScript and HTML (don't laugh, this was a serious learning project for me). The problem I'm having is that, after running the game for a while (having played, like to level 10 say), the HTA begins to slow down HORRIBLY. By level 10, it's almost unplayable... it takes like 3 seconds to register a button click. My messy code is below (yes, it's the entire game... I know it's huge). I don't really care that the math is horrible in calculating hit points and damage and whatnot. All I want to know is, why the hell does this slow down? Any help would be greatly appreciated. (obviously, rename the text file to .hta or .html to load it) Hi all How should I be doing this? I am trying to 'learn' how to set more than one value in a cookie. Then get them back out. Obviously i'm on the wrong track. These are my 'test' values: Code: var val = document.getElementById("yrname").value; //peterPan var val1 = document.getElementById("password").value; //tinkerBell //send to create cookie factory createCookie("inbed", val + '~' + val1, "1"); Then from url : alert(cookie) I get: inbed=peterPan~tinkerBell So far so good (well what I expected anyway) now using this function I completely lose tinkerBell. she was inbed with peterPan. Code: function readCookie(name) //name is passed in { var cookies = document.cookie.split(/~/g); //split at ~ //alert(cookies); //results: //cookies: inbed=peterPan,tinkerBell //cookies[0]: mytestcookie=peterPan // cookies[1]: tinkerBell //the last sighting var arg = name + "="; for ( var c = 0; c < cookies.length; ++c ) //iterate through the cookie { var ck = cookies[c]; //cookie array into an var //alert(ck); //inbed=peterPan (no tinkerBell -- not what I expected! //basically i'm now lost!!! //I don't get what happened to tinkerBell . if ( ck.indexOf(arg) == 0 ) //if the array at the index of arg 'name=' equal to position 0. { var temp = ck.split(/=/); //split the cookie array at = //alert(temp); //inbed=peterPan //alert(temp[0]); //inbed //alert(temp[1]); //peterPan , return decodeURI(temp[1]) //bring back array 1 } } return ""; } help on how I should be doing this much appreciated LT |