Finney_3's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Active Members
Active Posts:
75 (0.05 per day)
Joined:
17-April 10
Profile Views:
2,752
Last Active:
User is offline Mar 16 2014 08:48 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
AMD
Favorite Gaming Platform:
PC
Your Car:
Honda
Dream Kudos:
0
Icon   Finney_3 has not set their status

Posts I've Made

  1. In Topic: Adding to an Existing Array Using a Function

    Posted 16 Mar 2014

    I set of this fuction called pass to try and call in order to get the information to display into the obj 3 section which I left open. Do I need to target this object by using a index of 2elow.

    Code is below
    (function(){  // Beginning of self executing function
    
    // Starting point of Obj Array for Students
    console.log('------ Starting Point of OBJ ----------');
      var students = [
               {
                 Name: "James Bond",
            	        Address: {
            	            Street: "123 Street Name",
               	            City: "Winter Park",
               	            State: "Fl"
                    },
              GPS: [2.5, 3.5, 4.0]
            }, {
                Name: "Isaah Finney",
                Address: {
        	            Street: "99 Western Ave",
            	            City: "Skowhegan",
            	            State: "MA"
        	        },
    	        GPS: [1.5, 2.0, 2.8]
    	    },{
    	    Name: "",                 // Leaving this object empty to pass information into the space
               Address: {
                    Street: "",
                       City: "",
                       State: ""
    
                  },
               GPS:[]
          }
      ];
    
            console.log(students);
    
        var pass = function(Name:, Address:, Street:, City:, State:, GPS:){
    
           pass("Tyler Zhu","113 Chruch Hill Rd", "Waterville", "IL", [1.2, 3.4, 4.0]);
        };
        console.log(pass);
    
    
    
    
    
    
    
    
    })(); // End of self executing function
    
    
  2. In Topic: Adding to an Existing Array Using a Function

    Posted 16 Mar 2014

    The way you have provided the format which is way neater to read and I understand what I was doing. Thanks for the suggestion. When I go to make a function that will pass information into the array will it still follow the same structure as the rest by using index numbers. Or when I pass the information I should have the function format it before being pushed?

    This was a huge help and make my code more readable once again Thanks
  3. In Topic: Javascript Debug Issue

    Posted 14 Mar 2014

    That's good, I don't want anyone to locate them for me I'm just looking for some tips because I'm going know where with all the issues in this debugging assignment. The assignment has all types of issues but I mean I felt for the most part I was able to go and take a look at the easy syntax errors or fix the miss spellings.

    I guess I would be looking for the best way to see why the code won't work after I see no more errors in the console.log in firefox and chrome. There was a point where the code was not displaying anything at all. Is this when I should be calling console to look at the functions or methods that are being called?

    Once again thanks for taking the time.
  4. In Topic: Javascript Debug Issue

    Posted 14 Mar 2014

    This is a school assignment that I'm working on. The assignment was to debug all the known JS issues which were syntax, run time and logical errors. I have been trying to debug this for about 6 hours now LOL because I'm new and have been just trying to console and jshint my self through this. I used web storm to help with syntax errors but to be honest the assignment is not suppose to be hard I guess and the database file that it works with doesn't effect anything I'm trying to get working. I'll post the original code if that gives a better idea of what I have been doing. I'm not sure if it's even possible to understand by just looking at the regular code without the html file to show what it's suppose to be doing.

    I appreciate your time. The say the best thing to do is take a break from the code before you break it and I honestly think debuging is harder if you didn't write the code from the get go but I guess sometimes you will be working with other peoples work in this industry so it practical but it's a butt kicker right now.

    I mean syntax errors are easy to get but below is the original code.

    // Create privatized scope using a self-executing function
    (function(){
    	
    	// Variable initialization (DO NOT FIX ANY OF THE BELOW VAR's)
    	var resultsDIV = document.getElementById("results"),
    		searchInput = document.forms[0].search,
    		currentSearch = ''
    	;
    	
    	// Validates search query
    	var validqte == function(query){
    		
    		// Trim whitespace from start and end of search query
    		while(query.charAt(0) = " "){
    			query = query.substring(1, query.length);
    		};
    		while(query.charAt(query.length-1) === ""){
    			query = query.substring(0, query.length-1);
            };
    		
    		// Check search length, must have 3 characters
    		if(query.length < 3){
    			alert("Your search query is too small, try again.);
    			
    			// (DO NOT FIX THE LINE DIRECTLY BELOW)
    			searchInput.focus();
    			return;
    		};
    		
    		search(query);
    	};
    	
    	// Finds search matches
    	var search = function(query){
    		
    		// split the user's search query string into an array
    		var queryArray = query.join(" ");
    		
    		// array to store matched results from database.js
    		var results = [];
    
    		// loop through each index of db array
    		for(var i=0, j=db.length; i<j; i++){
    		
    			// each db[i] is a single video item, each title ends with a pipe "|"
    			// save a lowercase variable of the video title
    			var dbTitleEnd = db[i].indexOf('|');
    			var dbitem = db[i].tolowercase().substring(0, dbTitleEnd);
    			
    			// loop through the user's search query words
    			// save a lowercase variable of the search keyword
    			for(var ii=0, jj=queryArray.length; ii<jj; ii++){
    				var qitem = queryArray[ii].tolowercase();
    				
    				// is the keyword anywhere in the video title?
    				// If a match is found, push full db[i] into results array
    				var compare = dbitem.indexOf(qitem);
    				if(compare !== -1){
    					results.push(db[i]);
    				};
                };
            };
    		
    		results.sort();
    		
    		// Check that matches were found, and run output functions
    		if(results.length = 0){
    			noMatch();
    		}else{
    			showMatches(results);
    		};
    	};
    	
    	// Put "No Results" message into page (DO NOT FIX THE HTML VAR NOR THE innerHTML)
    	var noMatch = function(){
    		var html = ''+
    			'<p>No Results found.</p>'+
    			'<p style="font-size:10px;">Try searching for "Javascript".  Just an idea.</p>'
            ;
    		resultsDIV.innerHTML = html;
    	};
    	
    	// Put matches into page as paragraphs with anchors
    	var showMatches = function(results){
    		
    		// THE NEXT 4 LINES ARE CORRECT.
    		var html = '<p>Results</p>', 
    			title, 
    			url
    		;
    		
    		// loop through all the results search() function
    		for(var i=0, j=results.length; i<j; i++){
    		
    			// title of video ends with pipe
    			// pull the title's string using index numbers
    			titleEnd = results[i].indexOf('|');
    			title = results[i].subString(0, titleEnd);
    			
    			// pull the video url after the title
    			url = results[i].substring(results[i].indexOf('|')+1, results[i].length);
    			
    			// make the video link - THE NEXT LINE IS CORRECT.
    			html += '<p><a href=' + url + '>' + title + '</a></p>';
    		};
    		resultsDIV.innerHTML = html; //THIS LINE IS CORRECT.
    	};
    	
    	// The onsubmit event will be reviewed in upcoming Course Material.
    	// THE LINE DIRECTLY BELOW IS CORRECT
    	document.forms[0].onsubmit = function(){
    		var query = searchInput.value;
    		validqte(query);
    
            // return false is needed for most events - this will be reviewed in upcoming course material
            // THE LINE DIRECTLY BELOW IS CORRECT
    		return false;
        };
    
    })();
    
    
  5. In Topic: Javascript Debug Issue

    Posted 14 Mar 2014

    Thanks for the response, When I type in the search bar on the index page if I have coded this correctly it should show all the links from the search word java but when I type in java nothing is performing. I have tried to console log out to see where the code my be broke but maybe I'm doing it wrong.

    I know if I console.log outside of my functions it's displaying the message in the log that I have put so I was under the assumption that because it went to the console.log part that the above code is all correct. If I'm wrong this is probably my issues because I think if the log message shows the above functions must be good because in order to get to the console log it has to pass through the function.

    The alert is working when I only type in 1 letter and it displays as it's to small which is right but anything over 3 letters won't show anything. I run the code in console mode in firefox and don't see any errors at all so would this be more of a logical issues by using a wrong method?

    Also thank you for displaying my code, this is my first time attempting it :)

My Information

Member Title:
D.I.C Head
Age:
31 years old
Birthday:
May 18, 1983
Gender:
Interests:
Sports, Lifting, Gaming, Military-Marines
Years Programming:
1
Programming Languages:
Html, Xhtml, Css, Java Script and Php Learning

Contact Information

E-mail:
Private
Website URL:
Website URL  http://www.fragfest-gaming.com
Xfire:
Finney_3

Friends

Finney_3 hasn't added any friends yet.

Comments

Finney_3 has no profile comments yet. Why not say hello?