When I use $. Get (URL, Data, callback) to obtain an HTML segment and add it to the container issuereportiner iner, my callback is written as follows:
1 Function Appendcontenttoissuereport (o)
2 {
3 $ ( " # Issuereportiner iner " ). ATTR ( " Innerhtml " , O. responsetext );
4 }
This sectionCodeIt works normally in Firefox 3.0, but not in IE8 or IE7. After debugger, the statement $ ("# issuereportiner iner"). ATTR ("innerhtml", O. responsetext); produces an "unknown runtime error" exception. After thinking about and reading the materials, I understand that in IE, you must first create a new element and add the content to the new element, then add the new element to the container. Apply this method and change callback as follows to work properly:
1 Function Appenddatatodiv (o)
2 {
3 $ ( " <DIV/> " ). ATTR ( " Innerhtml " , O. responsetext). appendto ( " # Issuereportiner iner " );
4 }
References: http://www.mercurytide.com/knowledge/white-papers/issues-working-with-ajax