$0
 bounty
2
answers
Understanding parameters in an anonymous function (callback example)
6 years ago • support_man
There is an example in JavaScriptIsSexy for a simple callback that I'd like to understand a bit better: var friends = ["Mike", "Stacy", "Andy", "Rick"]; friends.forEach(function (eachName, index){ console.log(index + 1 + ". " + eachName); // 1. Mike, 2. Stacy, 3. Andy, 4. Rick​ }); In this case, how are the parameters eachName and index understood to mean the elements of the array (people's names as strings) and index numbers, respectively?
$0
 bounty
2
answers
how to get the selected index of the asp:DropDownList control using javascript
6 years ago • support_man
I have an asp.net page, and I want to hide a div on the page when the index of the asp:DropDownList is 0 using javascript. I know how to hide the div but I do need help on how to get the selected index of the asp:DropDownLists using javascript. This is what I have in the javascript: function hideDiv() { var drpCampDock = document.getElementById('drpListCampaignDocketTemplate'); var drpCampType = document.getElementById('drpCamp
$0
 bounty
0
answers
PHP Pagination Last id record
6 years ago • lampego1@qrid
I've the following Pagination code : $rec_limit = 3; /* Get total number of records */ $query = "SELECT count(id) FROM news"; $result = mysql_query($query); if(!$result) { die('Could not get data: ' . mysql_error()); } $row = mysql_fetch_array($result, MYSQL_NUM ); $rec_count = $row[0]; if( isset($_GET{'page'} ) ) { $page = $_GET{'page'} + 1; $offset = $rec_limit * $page ; } else { $page = 0; $offset = 0; } $left_rec = $rec_co
Tags: , ,
11 from 18