$get(' ')
$get(' ')
$get(' ')
$get(' ')
$get(' ')
$get(' ') $get(' ') $get(' ') $get(' ') $get(' ') $get(' ') $get(' ') $get(' ')
$get(' ') $get(' ')
$get(' ')
Go Back  Xtreme Visual Basic Talk > > > $get(' ')


Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2007, 04:34 PM
DoughBoy DoughBoy is offline
Centurion
 
Join Date: Jun 2006
Posts: 196
Default $get(' ')


I got wind of a lil macro in VS that a user can use to increase cross broswer compatibility.

To use $get instead of document.getElementbyID('').... Is this true? How do I use $get? I tried $get('theObjectName')... But I get an error. I tried searching high and low for more information but all roads are leading to dead ends. SO.... Can anyone give me a lil tip on the proper way of using $get or point me to a page that would tell me more information about $get.

Also, what other macros are there? Can someone give me a link to a page listing or something.

Many thanks! :-)
Reply With Quote
  #2  
Old 05-25-2007, 01:36 PM
wayneph's Avatar
wayneph$get(' ') wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

it's not really a macro. it's just another function. I actually use just the dollar sign for my pages.

In javascript you need to create a function like this (i'll use $get() since that's what you were looking for):
HTML Code:
function $get(id) {
  return document.getElementById(id);
}
Now just include this script in your pages. (I have a common .js file that gets included as part of my master page, or a include file in classic asp)

(I originally got this from the prototype library at http://prototypejs.org/)
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 05-25-2007, 04:37 PM
DoughBoy DoughBoy is offline
Centurion
 
Join Date: Jun 2006
Posts: 196
Default

I see... Bummers! I was excited to think VS had a neat trick up it's sleeve. No wonder why I couldn't find information about this, $get was probably specific to ONE person who programmed that function himself.

Thanks again for all your help!
Reply With Quote
  #4  
Old 05-31-2007, 10:46 AM
DoughBoy DoughBoy is offline
Centurion
 
Join Date: Jun 2006
Posts: 196
Default

After some more research with this topic... ASP.NET AJAX inherits "MicrosoftAjax.js" with the web application. Located within this file is the $get function that this thread questions. So, by default your ASP.NET AJAX application will have this function.
BUT.....
I had ASP.NET AJAX installed and never got this function working... It wasn't until I installed VS SP1 did I see this $get.....

So, to recap... Have VS SP1 installed and ASP.NET AJAX installed to use the inherited $get function.

(This is based on my experience)
Reply With Quote
  #5  
Old 06-01-2007, 10:21 AM
DoughBoy DoughBoy is offline
Centurion
 
Join Date: Jun 2006
Posts: 196
Default

The following link...
http://ajax.asp.net/docs/ClientRefer...l/default.aspx

is a link to a page that discusses the different inherited shortcut functions that comes with AJAX. It's under the, "Global Shortcuts to Commonly Used APIs" section.

Hope this helps anyone looking for more information on this subject.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
$get(' ')
$get(' ')
$get(' ') $get(' ')
$get(' ')
$get(' ')
$get(' ') $get(' ') $get(' ') $get(' ') $get(' ') $get(' ') $get(' ')
$get(' ')
$get(' ')
 
$get(' ')
$get(' ')
 
-->