Home All Groups Group Topic Archive Search About

How to use getElementById

Author
19 Jun 2009 1:03 AM
AAaron123
This is on a content aspx page (this contents ends up in the head section)

var map = new
google.maps.Map(document.getElementById("ctl00_BottomCPH_map_canvas"),
myOptions);





map_canvas is the id of a div element in contents BottomCPH.

It is on the same context aspx page .

The context BottomCPH is defined in a table cell on the master.

By looking at the source I found the name

ctl00_BottomCPH_map_canvas which works OK



I tried making the div runat server and using <'%=map_canvas%'>

but that didn't work.

Would you expect it to work?



Got any suggestion as to what might work other than using the expanded name,
ctl00_BottomCPH_map_canvas?

Also, what is the word I need to describe what happens to the name (better
than expand"?

Something like mangle, maybe.



Thanks

Author
19 Jun 2009 6:36 AM
Segundo Serrano
Hi,

use <'%=map_canvas.ClientId %'>

Regards,

S.
--------------------------------------------------------------------------------


Show quoteHide quote
"AAaron123" <aaaron***@roadrunner.com> wrote in message news:OFLL7mH8JHA.4820@TK2MSFTNGP04.phx.gbl...
> This is on a content aspx page (this contents ends up in the head section)
>
> var map = new
> google.maps.Map(document.getElementById("ctl00_BottomCPH_map_canvas"),
> myOptions);
>
>
>
>
>
> map_canvas is the id of a div element in contents BottomCPH.
>
> It is on the same context aspx page .
>
> The context BottomCPH is defined in a table cell on the master.
>
> By looking at the source I found the name
>
> ctl00_BottomCPH_map_canvas which works OK
>
>
>
> I tried making the div runat server and using <'%=map_canvas%'>
>
> but that didn't work.
>
> Would you expect it to work?
>
>
>
> Got any suggestion as to what might work other than using the expanded name,
> ctl00_BottomCPH_map_canvas?
>
> Also, what is the word I need to describe what happens to the name (better
> than expand"?
>
> Something like mangle, maybe.
>
>
>
> Thanks
>
>
Are all your drivers up to date? click for free checkup

Author
19 Jun 2009 12:51 PM
AAaron123
thanks
  "Segundo Serrano" <sserrano[at]jabs[dot]com[dot]pe> wrote in message news:uyXfVgK8JHA.4820@TK2MSFTNGP04.phx.gbl...
  Hi,

  use <'%=map_canvas.ClientId %'>

  Regards,

  S.
------------------------------------------------------------------------------


Show quoteHide quote
  "AAaron123" <aaaron***@roadrunner.com> wrote in message news:OFLL7mH8JHA.4820@TK2MSFTNGP04.phx.gbl...
  > This is on a content aspx page (this contents ends up in the head section)
  >
  > var map = new
  > google.maps.Map(document.getElementById("ctl00_BottomCPH_map_canvas"),
  > myOptions);
  >
  >
  >
  >
  >
  > map_canvas is the id of a div element in contents BottomCPH.
  >
  > It is on the same context aspx page .
  >
  > The context BottomCPH is defined in a table cell on the master.
  >
  > By looking at the source I found the name
  >
  > ctl00_BottomCPH_map_canvas which works OK
  >
  >
  >
  > I tried making the div runat server and using <'%=map_canvas%'>
  >
  > but that didn't work.
  >
  > Would you expect it to work?
  >
  >
  >
  > Got any suggestion as to what might work other than using the expanded name,
  > ctl00_BottomCPH_map_canvas?
  >
  > Also, what is the word I need to describe what happens to the name (better
  > than expand"?
  >
  > Something like mangle, maybe.
  >
  >
  >
  > Thanks
  >
  >
Author
19 Jun 2009 10:11 AM
Mark Rae [MVP]
"AAaron123" <aaaron***@roadrunner.com> wrote in message
news:OFLL7mH8JHA.4820@TK2MSFTNGP04.phx.gbl...

> var map = new
> google.maps.Map(document.getElementById("ctl00_BottomCPH_map_canvas"),
> myOptions);
>
> I tried making the div runat server and using <'%=map_canvas%'> but that
> didn't work.
>
> Would you expect it to work?

No.


> Got any suggestion as to what might work other than using the expanded
> name, ctl00_BottomCPH_map_canvas?

var map = new
google.maps.Map(document.getElementById("<%=map_canvas.ClientID%>"),
myOptions);


> Also, what is the word I need to describe what happens to the name (better
> than expand"?
>
> Something like mangle, maybe.

This is called munging:


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
19 Jun 2009 12:54 PM
AAaron123
Show quote Hide quote
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:Oo6thZM8JHA.1340@TK2MSFTNGP05.phx.gbl...
> "AAaron123" <aaaron***@roadrunner.com> wrote in message
> news:OFLL7mH8JHA.4820@TK2MSFTNGP04.phx.gbl...
>
>> var map = new
>> google.maps.Map(document.getElementById("ctl00_BottomCPH_map_canvas"),
>> myOptions);
>>
>> I tried making the div runat server and using <'%=map_canvas%'> but that
>> didn't work.
>>
>> Would you expect it to work?
>
> No.
>
>
>> Got any suggestion as to what might work other than using the expanded
>> name, ctl00_BottomCPH_map_canvas?
>
> var map = new
> google.maps.Map(document.getElementById("<%=map_canvas.ClientID%>"),
> myOptions);
>
>
>> Also, what is the word I need to describe what happens to the name
>> (better than expand"?
>>
>> Something like mangle, maybe.
>
> This is called munging:
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net

Thanks again
Author
19 Jun 2009 12:57 PM
AAaron123
I don't want to put words in your mouth but I believe you were not too
pleased with IE7.
I wonder how you feel about IE8?
Author
19 Jun 2009 1:13 PM
Mark Rae [MVP]
"AAaron123" <aaaron***@roadrunner.com> wrote in message
news:ezttO2N8JHA.1252@TK2MSFTNGP04.phx.gbl...

> I don't want to put words in your mouth but I believe you were not too
> pleased with IE7.
> I wonder how you feel about IE8?

Much better than IE7...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
19 Jun 2009 3:39 PM
AAaron123
Show quote Hide quote
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:uGh2v%23N8JHA.5704@TK2MSFTNGP03.phx.gbl...
> "AAaron123" <aaaron***@roadrunner.com> wrote in message
> news:ezttO2N8JHA.1252@TK2MSFTNGP04.phx.gbl...
>
>> I don't want to put words in your mouth but I believe you were not too
>> pleased with IE7.
>> I wonder how you feel about IE8?
>
> Much better than IE7...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
good to hear

thanks

Bookmark and Share