Today, I want to pass all the content of another webpage to a div of this webpage,CodeAs follows:
......
VaR xhttp = new activexobject ("Microsoft. XMLHTTP ");
Xhttp. Open ("get", "http: // 127.0.0.1/1.asp", false );
Xhttp. Send ();
Document. getelementbyid ("mydiv"). innerhtml = xhttp. responsetext;
......
No response.
I always thought that 1. asp was too complicated and failed. After trying for half a day, I finally tried to use this statement:
Document. getelementbyid ("mydiv"). innerhtml = "<HTML> <body> OK </body> I still can't. Finally, I made a comparison with the previous one to find that innerhtml was wrong and written as innerhtml. There are no prompts for vs2005 or IE! Bitter!
After the modification, I made another step. The error prompt is "unknown runtime error". After Google, I found the cause: I have a form on this page named form1, the new web page also has a form named form1, which causes a conflict. However, vs2005 did not point out the specific cause, but told you "unknown runtime error ".
Later, I found that JavaScript cannot be executed. In short, I feel that AJAX is a very immature technology for me.