Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. in javascript when calling any method then

in javascript when calling any method then

Scheduled Pinned Locked Moved ASP.NET
javascript
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 4659001
    wrote on last edited by
    #1

    in my project at one place sthing like this is been writen SetHistoryHandler( { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_GROUP, Contacts: contacts } ); i coule not understand what does this ':' doing when passing arguments for ex. one argument is Entity: PART_NEW_GROUP ,it contain ':' after Entity

    Raghvendra

    P 1 Reply Last reply
    0
    • M Member 4659001

      in my project at one place sthing like this is been writen SetHistoryHandler( { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_GROUP, Contacts: contacts } ); i coule not understand what does this ':' doing when passing arguments for ex. one argument is Entity: PART_NEW_GROUP ,it contain ':' after Entity

      Raghvendra

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      That is a Javascript object literal. It is similar to an array list, except the members are enclosed in curly brackets and each member is defined explicitly with a name, followed by a colon, and each member is separated with a comma, not a semi-colon. Once an object literal has been defined, then each member can be accessed with Object literal variable name.Member name For example, if you do this:

      var fruit = {apples: 1,
      bananas: 2,
      oranges: 3,
      grapes: 20
      };

      This creates an object with the members apples, bananas, oranges and grapes with values of 1, 2, 3 and 20 respectively. The members can be accessed like so:

      fruit.apples; //returns 1
      fruit.bananas; //returns 2
      fruit.oranges; //returns 3
      fruit.grapes; //returns 20

      Object literals are especially useful in argument lists, as it means that the arguments don't have to all be present, or have a set order to be defined in. Regards, --Perspx

      "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
      "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

      modified on Sunday, September 21, 2008 2:57 AM

      M 2 Replies Last reply
      0
      • P Perspx

        That is a Javascript object literal. It is similar to an array list, except the members are enclosed in curly brackets and each member is defined explicitly with a name, followed by a colon, and each member is separated with a comma, not a semi-colon. Once an object literal has been defined, then each member can be accessed with Object literal variable name.Member name For example, if you do this:

        var fruit = {apples: 1,
        bananas: 2,
        oranges: 3,
        grapes: 20
        };

        This creates an object with the members apples, bananas, oranges and grapes with values of 1, 2, 3 and 20 respectively. The members can be accessed like so:

        fruit.apples; //returns 1
        fruit.bananas; //returns 2
        fruit.oranges; //returns 3
        fruit.grapes; //returns 20

        Object literals are especially useful in argument lists, as it means that the arguments don't have to all be present, or have a set order to be defined in. Regards, --Perspx

        "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
        "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

        modified on Sunday, September 21, 2008 2:57 AM

        M Offline
        M Offline
        Member 4659001
        wrote on last edited by
        #3

        Thanks, now i cam corelate it in project

        Raghvendra

        1 Reply Last reply
        0
        • P Perspx

          That is a Javascript object literal. It is similar to an array list, except the members are enclosed in curly brackets and each member is defined explicitly with a name, followed by a colon, and each member is separated with a comma, not a semi-colon. Once an object literal has been defined, then each member can be accessed with Object literal variable name.Member name For example, if you do this:

          var fruit = {apples: 1,
          bananas: 2,
          oranges: 3,
          grapes: 20
          };

          This creates an object with the members apples, bananas, oranges and grapes with values of 1, 2, 3 and 20 respectively. The members can be accessed like so:

          fruit.apples; //returns 1
          fruit.bananas; //returns 2
          fruit.oranges; //returns 3
          fruit.grapes; //returns 20

          Object literals are especially useful in argument lists, as it means that the arguments don't have to all be present, or have a set order to be defined in. Regards, --Perspx

          "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
          "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

          modified on Sunday, September 21, 2008 2:57 AM

          M Offline
          M Offline
          Member 4659001
          wrote on last edited by
          #4

          i get it that SetHistoryHandler( { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_CONTACT } ); var fruit = {apples: 1, bananas: 2, oranges: 3, grapes: 20 }; sounds bit differ in my one { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_CONTACT } does not sounds some thing like anonimeous structure means it does not have any name so we can refer some where else i mean i could not get it fully when i do compare it, alone it make full sence to me

          Raghvendra

          P 1 Reply Last reply
          0
          • M Member 4659001

            i get it that SetHistoryHandler( { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_CONTACT } ); var fruit = {apples: 1, bananas: 2, oranges: 3, grapes: 20 }; sounds bit differ in my one { ScreenId: SCREEN_CONTACTS, Entity: PART_NEW_CONTACT } does not sounds some thing like anonimeous structure means it does not have any name so we can refer some where else i mean i could not get it fully when i do compare it, alone it make full sence to me

            Raghvendra

            P Offline
            P Offline
            Perspx
            wrote on last edited by
            #5

            SCREEN_CONTACTS and PART_NEW_CONTACT appear to be variables, so the values of ScreenId and Entity take the value of these variables. Regards, --Perspx

            "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
            "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

            M 1 Reply Last reply
            0
            • P Perspx

              SCREEN_CONTACTS and PART_NEW_CONTACT appear to be variables, so the values of ScreenId and Entity take the value of these variables. Regards, --Perspx

              "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
              "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

              M Offline
              M Offline
              Member 4659001
              wrote on last edited by
              #6

              Thanks

              Raghvendra

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups