Jump to content

Search the Community

Showing results for tags 'METHOD'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 5 results

  1. Hi, I'm studying a constructor function pattern. I have made this constructor: function Person( firstname, age, place ) { this.firstname = firstname; this.age = age; this.greeting = { Hello: function(){ console.log( "Hello " + firstname ); }, YouAre: function(){ console.log( "You are " + age + " years old"); } } this.greeting2 = { Hello: function(){ console.log( "Hello " + this.firstname ); }, YouAre: function(){ console.log( "You are " + this.age ); } } } Person.prototype = { greeting3: { Hello: function(){ console.log( "Hello " + this.firstname ); }, YouAre: function(){ console.log( "You are " + this.age ); } } } var Clara = new Person( 'Clara', '20' ); Clara.greeting.Hello(); // Hello Clara Clara.greeting.YouAre(); // You are 20 years old Clara.greeting2.Hello(); // Hello undefined Clara.greeting2.YouAre(); // You are undefined Clara.greeting3.Hello(); // Hello undefined Clara.greeting3.YouAre(); // You are undefined On the greeting2.Hello and greeting2.YouAre methods, 'this' name and age result is undefined, the same with greeting3 method. The question is: How do we get a property value through a method inside an object array? and who is 'this' in greeting2 and greeting3 functions? Thanks!
  2. Hello, while reading the tutorial about js i found this paragraph: According to Stack Overflow fullName is not a function, because the result depends on the state of the object and is not always the same. Maybe you need to correct this or be more precise with your definition of a function.
  3. Hi all, Im pretty much a noob to javascript. I try to get how the statements work together. if you have a javascript command like this: document.all.myFile.innerText Then document is an object and so is all myFIle is a variable but what is innerText ? Is that a property or a method? Are there any obligations in writing these commands? like this: object.subobject.property.method? Or are you free to use these through each other?
  4. Hello, im wondering how does jQuery get method work. Since it should not reload the page again? I've seen this, but how to example make this more automated whitout refreshing "http://mudsaf.info/games/index.php". $.ajax({ url: url, data: data, success: success, dataType: dataType});
  5. I am developing a function to find a particular element within another element identifier (similar to getElementById but that applies to any other element) ... Because this throws me arror: var ancestor = document.getElementById('divAncestor');var child = ancestor.getElementById('divChild'); I know, HTML specifies that ids must be unique but reality proves that often running scripts that can have items with the same ids. So, thats the reason why I'm not simply calling the child like this: var ancestor = document.getElementById('divChild'); The first option was to add this function to each HTML element, or at least the divs (because that's what interests me identify). The second, and is the one I prefer, is to add a method to the document object and call from there by passing the ID of the father and son as parameters. Is this possible?Thanks for your time.
  • Create New...