Problem in Declaration - JavaScript

Posted by Sivakumar.S under JavaScript on 5/29/2012 | Points: 10 | Views : 835 | Status : [Member] | Replies : 3
Hi,

I m facing improper display in the iframe pop up, while i am declare the Declaration 2, instead of Declaration1. What is the difference between the below two declarations:

Declaration 1
var frameid = '<%=frameToLoadMedHxPopUp.ClientID%>';
var dmidViewSummary = '<%=btnMedHxMainHidden.ClientID%>';

Declaration 2
var frameid = document.getElementById('<%=frameToLoadMedHxPopUp.ClientID%>');
var dmidViewSummary = document.getElementById('<%=btnMedHxMainHidden.ClientID%>');

siva


Responses

Posted by: Vijayamadhavareddy on: 5/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Siva,

In Declaration 1 , you are assigning id to variables where as
In Declaration 2 , you are assigning object or elements bearing id to the variables.

Vijay

Sivakumar.S, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gaur1982 on: 5/29/2012 [Member] Starter | Points: 25

Up
0
Down
Declaration 1: assign only the ID's of the control
Declaration 2: assign these id's controls as an object

Gaurav Agrawal
http://www.planetofcoders.com/

Sivakumar.S, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sivakumar.S on: 5/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi all,

Thanks for your reply...it works now...

siva

Sivakumar.S, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response