get first 5 values from a json data
from my json data i only have to fetch first 5 values.Using Jquery how it
is possible.
var server
=[{"jobid":"4","browser":"FF20","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:06 GMT+0530
(IST)","_id":"524d269a6d32804512000001"},{"jobid":"34","browser":"GC23","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:47 GMT+0530
(IST)","_id":"524d26c36d32804512000002"},{"jobid":"34","browser":"IE8","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:50 GMT+0530
(IST)","_id":"524d26c66d32804512000003"},{"jobid":"34","browser":"FF20","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:53 GMT+0530
(IST)","_id":"524d26c96d32804512000004"},{"jobid":"34","browser":"GC23","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:55 GMT+0530
(IST)","_id":"524d26cb6d32804512000005"},{"jobid":"34","browser":"IE8","subemail":"0poo","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:41:57 GMT+0530
(IST)","_id":"524d26cd6d32804512000006"},{"jobid":"86","browser":"FF20","subemail":"","userid":"0","names":"Guest","datetime":"Thu
Oct 03 2013 13:42:27 GMT+0530
(IST)","_id":"524d26eb6d32804512000007"},{"jobid":"86","browser":"GC23","subemail":"","userid":"0","names":"Guest","datetime":"Thu
Oct 03 2013 13:42:31 GMT+0530
(IST)","_id":"524d26ef6d32804512000008"},{"jobid":"86","browser":"IE8","subemail":"","userid":"0","names":"Guest","datetime":"Thu
Oct 03 2013 13:42:32 GMT+0530
(IST)","_id":"524d26f06d32804512000009"},{"jobid":"86","browser":"FF20","subemail":"","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:43:01 GMT+0530
(IST)","_id":"524d270d6d3280451200000a"},{"jobid":"86","browser":"GC23","subemail":"","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:43:03 GMT+0530
(IST)","_id":"524d270f6d3280451200000b"},{"jobid":"86","browser":"IE8","subemail":"","userid":"60","names":"abc@gmail.com","datetime":"Thu
Oct 03 2013 13:43:05 GMT+0530
(IST)","_id":"524d27116d3280451200000c"},{"jobid":"86","browser":"FF20","subemail":"","userid":"11","names":"priya@gmail.com","datetime":"Thu
Oct 03 2013 13:44:35 GMT+0530
(IST)","_id":"524d276b6d3280451200000d"},{"jobid":"86","browser":"GC23","subemail":"","userid":"11","names":"priya@gmail.com","datetime":"Thu
Oct 03 2013 13:44:37 GMT+0530
(IST)","_id":"524d276d6d3280451200000e"},{"jobid":"86","browser":"IE8","subemail":"","userid":"11","names":"priya@gmail.com","datetime":"Thu
Oct 03 2013 13:44:39 GMT+0530
(IST)","_id":"524d276f6d3280451200000f"},{"jobid":"86","browser":"FF20","subemail":"","userid":"11","names":"priya@gmail.com","datetime":"Thu
Oct 03 2013 13:45:13 GMT+0530 (IST)","_id":"524d27916d32804512000010"}]
serverResult.forEach(function (result) {
// How can i get the first 5 values from the json data
});
Bohren
Thursday, 3 October 2013
Wednesday, 2 October 2013
regex string that would validate specific alphanumeric format
regex string that would validate specific alphanumeric format
I need to validate a specific format of numbers and letters,
What would be the regex string that would check
nnnnnnnnnA (example 123456789A)
I tried ^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]{A-Z}$ but
it's not forcing the 9 number plus one letter
I need to validate a specific format of numbers and letters,
What would be the regex string that would check
nnnnnnnnnA (example 123456789A)
I tried ^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]^[0-9]{A-Z}$ but
it's not forcing the 9 number plus one letter
adress of a pointer variable
adress of a pointer variable
I'm currently learning c language, and I bumped into this code. ptr is
already a pointer type of variable, so what is the affect of the '&'
operator on it, cause I know that usualy the operator uses to get the
adress of non-pointer variable.
Tnx, Dean.
struct name {
int a; float b; char c[30];
};
int main()
{
struct name *ptr;
int i,n;
printf("Enter n: ");
scanf("%d",&n);
ptr = (struct name*)malloc(n*sizeof(struct name));
/* Above statement allocates the memory for n structures with pointer
ptr pointing to base address */
for(i=0; i<n; ++i) {
printf("Enter string, integer and floating number respectively:\n");
scanf("%s%d%f", &(ptr+i)->c, &(ptr+i)->a, &(ptr+i)->b);
}
}
I'm currently learning c language, and I bumped into this code. ptr is
already a pointer type of variable, so what is the affect of the '&'
operator on it, cause I know that usualy the operator uses to get the
adress of non-pointer variable.
Tnx, Dean.
struct name {
int a; float b; char c[30];
};
int main()
{
struct name *ptr;
int i,n;
printf("Enter n: ");
scanf("%d",&n);
ptr = (struct name*)malloc(n*sizeof(struct name));
/* Above statement allocates the memory for n structures with pointer
ptr pointing to base address */
for(i=0; i<n; ++i) {
printf("Enter string, integer and floating number respectively:\n");
scanf("%s%d%f", &(ptr+i)->c, &(ptr+i)->a, &(ptr+i)->b);
}
}
How to count the number of tables under a certain element in jQuery?
How to count the number of tables under a certain element in jQuery?
Using jQuery is it possible to check if there is more than one table
nested below a div with a certain class id?
Using jQuery is it possible to check if there is more than one table
nested below a div with a certain class id?
Tuesday, 1 October 2013
PHP While Loop returning 1 result should be returning 15?
PHP While Loop returning 1 result should be returning 15?
I wrote a function that should return all users in the database. It's
printing the array, but it's only printing one result. Why is it doing
this? I surrounded it in a while loop and put a limit in my query...
Code:
function getAllUsers() {
global $PDO;
$stm = $PDO->prepare("SELECT * FROM `users` ORDER BY `bid` DESC LIMIT
15");
$stm->execute();
while($Array = $stm->fetch()) {
return print_r($Array);
}
}
I wrote a function that should return all users in the database. It's
printing the array, but it's only printing one result. Why is it doing
this? I surrounded it in a while loop and put a limit in my query...
Code:
function getAllUsers() {
global $PDO;
$stm = $PDO->prepare("SELECT * FROM `users` ORDER BY `bid` DESC LIMIT
15");
$stm->execute();
while($Array = $stm->fetch()) {
return print_r($Array);
}
}
jQuery $ is not defined
jQuery $ is not defined
Normally I would be able to figure this one out but this one has me trumped.
I inherited a project at work that is.. horrifying. I've cleaned it all up
and everything, except for the javascript/jquery.
I have a simple document ready click alert("test") function running, (and
it works??) in an external javascript file. If I include jQuery 1.9.0, the
alert pops up twice (which according to the console it is being called
somewhere.. so including it where I did seemed to be a duplicate).
So my question is what cases would cause jQuery to work, yet trigger the
undefined $?
And .noConflict() is NOT being called.
The code is called here:
$(document).ready(function() {
$("#contactSecondaryYes").click(function(){
alert($(this).val());
});
});
Normally I would be able to figure this one out but this one has me trumped.
I inherited a project at work that is.. horrifying. I've cleaned it all up
and everything, except for the javascript/jquery.
I have a simple document ready click alert("test") function running, (and
it works??) in an external javascript file. If I include jQuery 1.9.0, the
alert pops up twice (which according to the console it is being called
somewhere.. so including it where I did seemed to be a duplicate).
So my question is what cases would cause jQuery to work, yet trigger the
undefined $?
And .noConflict() is NOT being called.
The code is called here:
$(document).ready(function() {
$("#contactSecondaryYes").click(function(){
alert($(this).val());
});
});
Dell Inspiron 1545 not detecting Wifi networks. Ubuntu 13.04 64-bit
Dell Inspiron 1545 not detecting Wifi networks. Ubuntu 13.04 64-bit
pI just installed Ubuntu 13.04 onto my Dell inspiron 1545. I've tried
almost everything on askubuntu with no luck. My wifi network is not being
detected at all and I cannot manually add it. Please help!/p
pI just installed Ubuntu 13.04 onto my Dell inspiron 1545. I've tried
almost everything on askubuntu with no luck. My wifi network is not being
detected at all and I cannot manually add it. Please help!/p
Subscribe to:
Comments (Atom)