# Script block in popup.contentHtml

**URL:** <https://community.thinkgeo.com/t/script-block-in-popup-contenthtml/6089>\
**Category:** WebForms\
**Created:** [January 5, 2012, 1:50am UTC](https://community.thinkgeo.com/t/script-block-in-popup-contenthtml/6089 "2012-01-05T01:50:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre\_francois](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@andre\_francois](https://community.thinkgeo.com/u/andre_francois)\
**Post date:** [January 5, 2012, 1:50am UTC](https://community.thinkgeo.com/t/script-block-in-popup-contenthtml/6089/1 "2012-01-05T01:50:45Z")

</div>

&nbsp;

Hello,

I&nbsp;tried&nbsp;to&nbsp;add&nbsp;a&nbsp;scriptblock&nbsp;in&nbsp;the&nbsp;contentHtml&nbsp;of&nbsp;my&nbsp;popups&nbsp;like:

&nbsp;

&nbsp;

this.Popup.ContentHtml&nbsp;=&nbsp;"\<script type='text/javascript'\>getToolTipContent('[#MARKERNAME#]')\</script\>"\</font\>\</font\>\</font\>

and&nbsp;in&nbsp;the&nbsp;page&nbsp;which&nbsp;contains&nbsp;the&nbsp;map:

&nbsp;

function&nbsp;getToolTipContent(nom)  
  
{  
  
&nbsp;document.getElementById(nom).innerHTML&nbsp;=&nbsp;nom;//for&nbsp;example  
  
}

But&nbsp;it&nbsp;does'nt&nbsp;work.&nbsp;Have&nbsp;you&nbsp;some&nbsp;ideas&nbsp;to&nbsp;help&nbsp;me&nbsp;please?

Thank&nbsp;you,

André-François

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 9, 2012, 2:24pm UTC](https://community.thinkgeo.com/t/script-block-in-popup-contenthtml/6089/2 "2012-01-09T14:24:08Z")

</div>

Hi&nbsp;Andre&nbsp;Francois:

I&nbsp;think&nbsp;this&nbsp;test&nbsp;code&nbsp;should&nbsp;work&nbsp;for&nbsp;you:

&nbsp;

Server&nbsp;side:&nbsp;&nbsp;&nbsp;&nbsp;

`CloudPopup p = new CloudPopup("", Map1.CurrentExtent.GetCenterPoint());            p.ContentHtml = "<input type='button' onclick=javascript:getToolTipContent('pointName');></input>";            Map1.Popups.Add(p);`  
  
Client&nbsp;side:  
  
`<script language =javascript>        function getToolTipContent(nom) {            alert(nom);            //document.getElementById(nom).innerHTML = nom; //for example        }     </script>`

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 9, 2012, 2:29pm UTC](https://community.thinkgeo.com/t/script-block-in-popup-contenthtml/6089/3 "2012-01-09T14:29:04Z")

</div>

Hi&nbsp;Andre&nbsp;Francois:&nbsp;  
&nbsp;I&nbsp;think&nbsp;this&nbsp;test&nbsp;code&nbsp;should&nbsp;work&nbsp;for&nbsp;you:&nbsp;  
&nbsp;&nbsp;  
&nbsp;Server&nbsp;side:&nbsp;  
&nbsp;`CloudPopup p = new CloudPopup("", Map1.CurrentExtent.GetCenterPoint());p.ContentHtml = “<input type=‘button’ onclick=javascript:getToolTipContent(‘pointName’);></input>”;Map1.Popups.Add§;`&nbsp;  
&nbsp;&nbsp;  
&nbsp;Client&nbsp;side:&nbsp;  
&nbsp;`<script language =javascript>        function getToolTipContent(nom) {            alert(nom);            //document.getElementById(nom).innerHTML = nom; //for example        }     </script>`
