Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually the bell Function is called when some one clicks on a button that button's ID is catched by this function --- function SetID(ID) ID == Button's ID

I dont Understand this part of code --
Mode:$(strID)[0].value
what does it mean
JavaScript
function SetID(ID) 
{
      //debugger;
      var strID = "#" + ID;
                    
      $.get('Dynamic_page.aspx', { Id: ID, Mode:$(strID)[0].value }, function() {});

      //callAjax();
                     
      //ID = "#" + ID;
      if ($(strID)[0].value == "Follow") 
      {
            $(strID)[0].value = "UnFollow";                     
      }
      else 
      {
            $(strID)[0].value = "Follow";                   
      }
}
Posted
v2
Comments
sr_24 27-Feb-13 6:29am    
Mode:$(strID)[0].value

what Does [o] Means ?? Anyone Please Describe ...thanks in advance

The code
JavaScript
$(strID)[0].value

is pointing to value property of first element with id equal to ID.
Note, that there is no “o”, but “0” (zero) in brackets, which indicates Array type of variable.

UPDATE:
In the $.get ... line you are providing the “Mode” property into your GET AJAX call with value mentioned above.
 
Share this answer
 
v3
Comments
sr_24 27-Feb-13 7:09am    
What is Mode in Mode:$(strID)[0].value ???
Quote:
JavaScript
$.get('Dynamic_page.aspx', { Id: ID, Mode:$(strID)[0].value }, function() {});

Id and Mode are the Parameters/Data (whose values are ID and $(strID)[0].value respectively) you are passing to Dynamic_page.aspx Page.

Refer - jQuery.get()[^]
Go to - Examples -> Example -> Request the test.php page and send some additional data along (while still ignoring the return results).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900