I can't find $get syntax information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Kotuby

    #1

    I can't find $get syntax information

    Hi all,
    I was just looking at some example code in the VS2008 help for VB. In a
    JavaScript example I came across some syntax that I didn't recognize and
    could not find information about on the usual JS sites I use as resources.
    In a place where I expected to see "document.getEl ementById('elem entId')",
    instead the Microsoft example use the syntax "$get('elementi d')".

    So I tried it in some of my code and it seems to work fine.

    Can somebody explain this short-hand syntax to me or at least point to a
    resource where I can read about it? It sure beats the heck out of typing
    document.getEle mentById.

    I just want to make sure I won't run into any compatibility problems if I
    start using that syntax regularly.

    Thanks in advance...


  • Anthony Jones

    #2
    Re: I can't find $get syntax information

    "John Kotuby" <jkotuby75@comc ast.netwrote in message
    news:%23yzS$Wqt IHA.3804@TK2MSF TNGP02.phx.gbl. ..
    Hi all,
    I was just looking at some example code in the VS2008 help for VB. In a
    JavaScript example I came across some syntax that I didn't recognize and
    could not find information about on the usual JS sites I use as resources.
    In a place where I expected to see "document.getEl ementById('elem entId')",
    instead the Microsoft example use the syntax "$get('elementi d')".
    >
    So I tried it in some of my code and it seems to work fine.
    >
    Can somebody explain this short-hand syntax to me or at least point to a
    resource where I can read about it? It sure beats the heck out of typing
    document.getEle mentById.
    >
    I just want to make sure I won't run into any compatibility problems if I
    start using that syntax regularly.
    >

    Something in the JS files included by MS adds this function:-

    function $get(id) { return document.getEle mentById(id); }

    $get isn't defined by the script context.


    --
    Anthony Jones - MVP ASP/ASP.NET


    Comment

    • Lloyd Sheen

      #3
      Re: I can't find $get syntax information


      "John Kotuby" <jkotuby75@comc ast.netwrote in message
      news:%23yzS$Wqt IHA.3804@TK2MSF TNGP02.phx.gbl. ..
      Hi all,
      I was just looking at some example code in the VS2008 help for VB. In a
      JavaScript example I came across some syntax that I didn't recognize and
      could not find information about on the usual JS sites I use as resources.
      In a place where I expected to see "document.getEl ementById('elem entId')",
      instead the Microsoft example use the syntax "$get('elementi d')".
      >
      So I tried it in some of my code and it seems to work fine.
      >
      Can somebody explain this short-hand syntax to me or at least point to a
      resource where I can read about it? It sure beats the heck out of typing
      document.getEle mentById.
      >
      I just want to make sure I won't run into any compatibility problems if I
      start using that syntax regularly.
      >
      Thanks in advance...
      >

      Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


      LS

      Comment

      • John Kotuby

        #4
        Re: I can't find $get syntax information

        Thank you Anthony,

        That is VERY important to know.
        I did not knowingly include any Microsoft JS files in my code.
        When I look at the HTML source in the IE7 browser I can't find any function
        declaration for $get() or a reference to the .js file.
        But I have a bunch of 3rd party controls that that generate almost
        unreadable JavaScript, so maybe I missed it.
        I am now wondering if the IE browser simply interprets it correctly.

        Have a good day.

        "Anthony Jones" <Ant@yadayadaya da.comwrote in message
        news:umB%23agqt IHA.1316@TK2MSF TNGP06.phx.gbl. ..
        "John Kotuby" <jkotuby75@comc ast.netwrote in message
        news:%23yzS$Wqt IHA.3804@TK2MSF TNGP02.phx.gbl. ..
        >Hi all,
        >I was just looking at some example code in the VS2008 help for VB. In a
        >JavaScript example I came across some syntax that I didn't recognize and
        >could not find information about on the usual JS sites I use as
        >resources.
        >In a place where I expected to see
        >"document.getE lementById('ele mentId')",
        >instead the Microsoft example use the syntax "$get('elementi d')".
        >>
        >So I tried it in some of my code and it seems to work fine.
        >>
        >Can somebody explain this short-hand syntax to me or at least point to a
        >resource where I can read about it? It sure beats the heck out of typing
        >document.getEl ementById.
        >>
        >I just want to make sure I won't run into any compatibility problems if I
        >start using that syntax regularly.
        >>
        >
        >
        Something in the JS files included by MS adds this function:-
        >
        function $get(id) { return document.getEle mentById(id); }
        >
        $get isn't defined by the script context.
        >
        >
        --
        Anthony Jones - MVP ASP/ASP.NET
        >
        >

        Comment

        • John Kotuby

          #5
          Re: I can't find $get syntax information

          Thanks Lloyd,

          When I typed in the search term $get in the native VS2008 help, I got
          nothing even remotely related.
          When I typed that same term into the searchbox on the page you provided, the
          2nd article returned had exactly what I needed.

          Many thanks...

          "Lloyd Sheen" <a@b.cwrote in message
          news:%232X5Skqt IHA.748@TK2MSFT NGP05.phx.gbl.. .
          >
          "John Kotuby" <jkotuby75@comc ast.netwrote in message
          news:%23yzS$Wqt IHA.3804@TK2MSF TNGP02.phx.gbl. ..
          >Hi all,
          >I was just looking at some example code in the VS2008 help for VB. In a
          >JavaScript example I came across some syntax that I didn't recognize and
          >could not find information about on the usual JS sites I use as
          >resources. In a place where I expected to see
          >"document.getE lementById('ele mentId')", instead the Microsoft example use
          >the syntax "$get('elementi d')".
          >>
          >So I tried it in some of my code and it seems to work fine.
          >>
          >Can somebody explain this short-hand syntax to me or at least point to a
          >resource where I can read about it? It sure beats the heck out of typing
          >document.getEl ementById.
          >>
          >I just want to make sure I won't run into any compatibility problems if I
          >start using that syntax regularly.
          >>
          >Thanks in advance...
          >>
          >
          >
          Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.

          >
          LS

          Comment

          • George Ter-Saakov

            #6
            Re: I can't find $get syntax information

            I bet you are referencing the external JavaScript file

            Just do not look for .js

            Look for script tag.
            You will find it in a form like this
            <script src="/WebResource.axd ?.....">

            That is where $get is defined.

            George.




            "John Kotuby" <jkotuby75@comc ast.netwrote in message
            news:u9SBxtqtIH A.4076@TK2MSFTN GP06.phx.gbl...
            Thank you Anthony,
            >
            That is VERY important to know.
            I did not knowingly include any Microsoft JS files in my code.
            When I look at the HTML source in the IE7 browser I can't find any
            function declaration for $get() or a reference to the .js file.
            But I have a bunch of 3rd party controls that that generate almost
            unreadable JavaScript, so maybe I missed it.
            I am now wondering if the IE browser simply interprets it correctly.
            >
            Have a good day.
            >
            "Anthony Jones" <Ant@yadayadaya da.comwrote in message
            news:umB%23agqt IHA.1316@TK2MSF TNGP06.phx.gbl. ..
            >"John Kotuby" <jkotuby75@comc ast.netwrote in message
            >news:%23yzS$Wq tIHA.3804@TK2MS FTNGP02.phx.gbl ...
            >>Hi all,
            >>I was just looking at some example code in the VS2008 help for VB. In a
            >>JavaScript example I came across some syntax that I didn't recognize and
            >>could not find information about on the usual JS sites I use as
            >>resources.
            >>In a place where I expected to see
            >>"document.get ElementById('el ementId')",
            >>instead the Microsoft example use the syntax "$get('elementi d')".
            >>>
            >>So I tried it in some of my code and it seems to work fine.
            >>>
            >>Can somebody explain this short-hand syntax to me or at least point to a
            >>resource where I can read about it? It sure beats the heck out of typing
            >>document.getE lementById.
            >>>
            >>I just want to make sure I won't run into any compatibility problems if
            >>I
            >>start using that syntax regularly.
            >>>
            >>
            >>
            >Something in the JS files included by MS adds this function:-
            >>
            >function $get(id) { return document.getEle mentById(id); }
            >>
            >$get isn't defined by the script context.
            >>
            >>
            >--
            >Anthony Jones - MVP ASP/ASP.NET
            >>
            >>
            >
            >

            Comment

            • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

              #7
              RE: I can't find $get syntax information

              $get is defined with the ajax javascript library in the global namespace:

              Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


              if you include the ajax script manager on your page, it will include scripts
              to define it.

              -- bruce (sqlwork.com)


              "John Kotuby" wrote:
              Hi all,
              I was just looking at some example code in the VS2008 help for VB. In a
              JavaScript example I came across some syntax that I didn't recognize and
              could not find information about on the usual JS sites I use as resources.
              In a place where I expected to see "document.getEl ementById('elem entId')",
              instead the Microsoft example use the syntax "$get('elementi d')".
              >
              So I tried it in some of my code and it seems to work fine.
              >
              Can somebody explain this short-hand syntax to me or at least point to a
              resource where I can read about it? It sure beats the heck out of typing
              document.getEle mentById.
              >
              I just want to make sure I won't run into any compatibility problems if I
              start using that syntax regularly.
              >
              Thanks in advance...
              >
              >
              >

              Comment

              Working...