PDA

View Full Version : [solved] What is -> console.info



hga77
11 Oct 2007, 2:08 AM
My function includes a line of code that I don't understand.
The line is:

console.info(jsonData);

This line is causing an error in IE. ok on FF.

What is console? and info?

You can find this line within the function "update", below:


function update()
{
var jsonData = "[";
var totalUpdated=0;
for(i=0;i<ds.getCount();i++)
{
var record = ds.getAt(i);
if(record.data.newRecord || record.dirty)
{
jsonData += Ext.util.JSON.encode(record.data) + ",";
totalUpdated++;
}
}

if(totalUpdated==0)
{
Ext.MessageBox.alert('Error', 'You have not made any changes!');
return;
}

jsonData = jsonData.substring(0,jsonData.length-1) + "]";

console.info(jsonData); //THIS IS CAUSING THE ERROR IN IE

gridForm.submit({
waitMsg: 'Updating, please wait...',
url:App.baseUrl +'index.php/videos/update',
params:{updateData:jsonData},
success:function(form, action)
{
ds.load();
Ext.MessageBox.alert('Confirm', action.result.info);
},
failure: function(form, action)
{
Ext.MessageBox.alert('Error Message', action.result.info);
}
});
}


Thanks

brian.moeskau
11 Oct 2007, 3:06 AM
It is a Firebug-specific logging statement, not supported by IE.

http://www.getfirebug.com/logging.html

If you are using the debug version of Ext (ext-all-debug.js) and you do a console.log, it will actually show the Ext debugger in IE. It would probably be useful to also support console.info/debug/warn/error in the Ext debug class as well...

hga77
11 Oct 2007, 5:07 AM
Thanks. Exactly what i needed to know.