r8899@llin: dpavlin | 2005-11-16 16:32:37 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Nov 2005 15:33:08 +0000 (15:33 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Nov 2005 15:33:08 +0000 (15:33 +0000)
 I have doubts about this fix -- elParent.tagName

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@66 07558da8-63fa-0310-ba24-9fe276d99e06

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