I am using jQuery in one of my current project and face some problem in incorporation.
Here is the functions which I am using as follows:
$.fn.getEcval = function(c){
var objType = c.type; // get the value of 'pul' through alert.
var hdf = $('input[name="eq"]').val();
var objHdf = jQuery.parseJSON(hdf);
alert(objHdf.objType); // get "undefined" through alert
};
$.fn.get_phnum = function(){
var url = $.fn.getEcval({'type':'pul'});
};
In $.fn.getEcval I send the parameter to get the value. I put the JSON string in my HTML hidden field. I get the string in the variable "hdf" which I have declared in the function.
When I run it in the browser the alert function return undefined. But instead of objType if I put pul (i.e alert(objHdf.pul)) I get the proper output.
Here is the JSON data as stated below:
{
"flg": 1,
"alrd": 1,
"drplen": 2,
"qrr": "7055eced15538bfb7c07f8a5b28fc5d07055eced15538bfb",
"wfa": 0,
"ctp": "1",
"pul": "b7c07f8a5b28fc5"
}
Any help in this regard will be highly appreciated.