|
I wrote this function to supress and report error
messages within _javascript_, all works fine except that when calling the function
"msg = fnFormElements();" it does not return anything, but when I call the
function "fnFormElements()" directly from a page it returns all elements.. What
am I missing? Anyone?
window.onerror = fnErrorReporting
function fnFormElements()
{ var objF = document.forms var msg = ""; for ( i=0; i < objF.length ;) { msg = msg + " Form: " + objF[i].name + "\n"; var objE = objF[i].elements; for ( i2=0; i2 < objE.length ;) { msg = msg + " Element name: " + objE[i2].name + " Value: " + objE[i2].value + "\n"; i2++; } i++; } alert(msg); return msg; } function fnErrorReporting( message, url, line
)
---{ msg = fnFormElements(); alert("Message: " + message + "\nURL: " + url + "\nLine #: " + line + "\nCookie: " + document.cookie + "\nBrowser: " + navigator.appName + " V" + navigator.appVersion + "\nMIME: " + navigator.mimeTypes + "\nPlatform: " + navigator.platform + "\nUseragent: " + navigator.userAgent + "\nForm Fields: " + msg); } You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/ |
