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
  1. Home
  2. Web Development
  3. JavaScript
  4. jQuery Question

jQuery Question

Scheduled Pinned Locked Moved JavaScript
javascriptquestionlearning
8 Posts 7 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.
  • B Offline
    B Offline
    BobInNJ
    wrote on last edited by
    #1

    I am trying to learn the library jQuery which is used in JavaScript. Please consider the following line of code which I got from the book "Pro jQuery":

    var jq = $( 'img[src*=daffod[i]' );

    I do not understand the meaning of:

    src*=daddod[i]

    Please tell me what *= means. Thanks Bob

    D L G M 4 Replies Last reply
    0
    • B BobInNJ

      I am trying to learn the library jQuery which is used in JavaScript. Please consider the following line of code which I got from the book "Pro jQuery":

      var jq = $( 'img[src*=daffod[i]' );

      I do not understand the meaning of:

      src*=daddod[i]

      Please tell me what *= means. Thanks Bob

      D Offline
      D Offline
      dusty_dex
      wrote on last edited by
      #2

      src *= daffod[i]

      is shorthand way of using this..

      src = src * daffod[i];

      it's a multiply combined with an assignment

      "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

      Richard DeemingR 1 Reply Last reply
      0
      • B BobInNJ

        I am trying to learn the library jQuery which is used in JavaScript. Please consider the following line of code which I got from the book "Pro jQuery":

        var jq = $( 'img[src*=daffod[i]' );

        I do not understand the meaning of:

        src*=daddod[i]

        Please tell me what *= means. Thanks Bob

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        See http://www.w3schools.com/js/js_operators.asp[^].

        Use the best guess

        1 Reply Last reply
        0
        • B BobInNJ

          I am trying to learn the library jQuery which is used in JavaScript. Please consider the following line of code which I got from the book "Pro jQuery":

          var jq = $( 'img[src*=daffod[i]' );

          I do not understand the meaning of:

          src*=daddod[i]

          Please tell me what *= means. Thanks Bob

          G Offline
          G Offline
          Graham Breach
          wrote on last edited by
          #4

          That is the attribute contains selector[^]

          1 Reply Last reply
          0
          • D dusty_dex

            src *= daffod[i]

            is shorthand way of using this..

            src = src * daffod[i];

            it's a multiply combined with an assignment

            "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            dusty_dex wrote:

            it's a multiply combined with an assignment

            Not in a jQuery selector it isn't! ;P


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            D 1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              dusty_dex wrote:

              it's a multiply combined with an assignment

              Not in a jQuery selector it isn't! ;P


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              D Offline
              D Offline
              dusty_dex
              wrote on last edited by
              #6

              Yep, I know this now. :mad: Why on Earth do they have to pick operators that are in common use already? Operator abuse it just ain't healthy. :thumbsdown:

              "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

              J 1 Reply Last reply
              0
              • D dusty_dex

                Yep, I know this now. :mad: Why on Earth do they have to pick operators that are in common use already? Operator abuse it just ain't healthy. :thumbsdown:

                "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

                J Offline
                J Offline
                Jasmine2501
                wrote on last edited by
                #7

                There's only 30 symbols easy to type on a normal keyboard. We have to share those between different languages. It's confusing at first but over time you'll learn to interpret the various languages without too much thinking about it.

                1 Reply Last reply
                0
                • B BobInNJ

                  I am trying to learn the library jQuery which is used in JavaScript. Please consider the following line of code which I got from the book "Pro jQuery":

                  var jq = $( 'img[src*=daffod[i]' );

                  I do not understand the meaning of:

                  src*=daddod[i]

                  Please tell me what *= means. Thanks Bob

                  M Offline
                  M Offline
                  Member 565451
                  wrote on last edited by
                  #8

                  You can infer from this example:- $(“a[href*=jquery.com]”) This selector matches all elements that reference the jQuery site. That means: it selects all elements that has a value 'jquery.com' in it's attribute 'href'. (* means anywhere in the string, ^ means begins with, $ means ends with)

                  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