r8899@llin: dpavlin | 2005-11-16 16:32:37 +0100
[webpac2] / web / iwf / iwfajax.js
index 7d48796..d68e5c8 100644 (file)
@@ -458,11 +458,13 @@ function _iwfInsertHtml(html, parentNodeId){
                        // our html to inject contains a form node.\r
                        // bubble up the chain until we find a <form> node, or we have no parents\r
                        var elParent = el;\r
-                       while (elParent && elParent.tagName.toLowerCase() != 'form'){\r
+                       // I have doubts about adding elParent.tagName here\r
+                       // but I don't have better idea. -dpavlin\r
+                       while (elParent && elParent.tagName && elParent.tagName.toLowerCase() != 'form'){\r
                                elParent = iwfGetParent(elParent);\r
                        }\r
 \r
-                       if (elParent && elParent.tagName.toLowerCase() == 'form'){\r
+                       if (elParent && elParent.tagName && elParent.tagName.toLowerCase() == 'form'){\r
                                iwfLog('IWF Ajax Error: Attempting to inject html which contains a <form> node into a target element which is itself a <form> node, or is already contained by a <form> node.\nThis is bad html, and will not work appropriately on some major browsers.', true);\r
                        }\r
                }\r