Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
- for (var key in validation_messages) {
- if (validation_messages.hasOwnProperty(key)) {
- var obj = validation_messages[key];
- for (var prop in obj) {
- // important check that this is objects own property
- // not from prototype prop inherited
- if(obj.hasOwnProperty(prop)){
- alert(prop + " = " + obj[prop]);
- }
- }
- }
- }
- var validation_messages = {
- "key_1": {
- "your_name": "jimmy",
- "your_msg": "hello world"
- },
- "key_2": {
- "your_name": "billy",
- "your_msg": "foo equals bar"
- }
- }
- var validation_messages = {
- "key_1": {
- "your_name": "jimmy",
- "your_msg": "hello world"
- },
- "key_2": {
- "your_name": {
- "first_name" : "Ratan",
- "secound_name" : "Tata",
- },
- "your_msg": "foo equals bar"
- }
- }
- "your_name = jimmy"
- "your_msg = hello world"
- "your_name = [object Object]"
- "your_msg = foo equals bar"
- var validation_messages = {
- "key_1": {
- "your_name": "jimmy",
- "your_msg": "hello world"
- },
- "key_2": {
- "your_name": {
- "first_name" : "Ratan",
- "secound_name" : "Tata",
- },
- "your_msg": "foo equals bar"
- }
- }
- for (var key in validation_messages) {
- if (validation_messages.hasOwnProperty(key)) {
- var obj = validation_messages[key];
- for (var prop in obj) {
- // important check that this is objects own property
- // not from prototype prop inherited
- if(typeof prop != 'string') {
- for(var obj_key in prop) {
- var obj = prop[obj_key];
- for (var prop in obj){
- console.log(prop + " = " + obj[prop]);
- }
- }
- }
- if(obj.hasOwnProperty(prop)){
- console.log(prop + " = " + obj[prop]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement