代码如下:this.Response.Write("<script language=JavaScript>");
this.Response.Write("var str;");
this.Response.Write("str=document.edit.txtbox1.value;");
this.Response.Write("str=str+'<img src=UploadImg/"+newfilename + expandName+">';");
this.Response.Write("document.edit.txtbox1.value=str;");
this.Response.Write("</script>");
请问怎么样实现?
this.Response.Write("var str;");
this.Response.Write("str=document.edit.txtbox1.value;");
this.Response.Write("str=str+'<img src=UploadImg/"+newfilename + expandName+">';");
this.Response.Write("document.edit.txtbox1.value=str;");
this.Response.Write("</script>");
请问怎么样实现?
你把HTML贴出来看看
<OBJECT id="txtbox" type="text/x-scriptlet" height="360" width="690" data="editor/editor.html" name="doc_html" VIEWASTEXT></OBJECT>在一个aspx文件中嵌套了一个文本编辑器,当单击上传按钮时在编辑其中追加图片url
this.Response.Write("<script language=JavaScript>");
this.Response.Write("var str;");
this.Response.Write("str=document.edit.txtbox1.value;");
//获取当前txtbox1的值,赋给变量str
this.Response.Write("str=str+'<img src=UploadImg/"+newfilename + expandName+">';");
//把上传图片得到的img url追加到文本里
this.Response.Write("document.edit.txtbox1.value=str;");
//重新给文本赋值
this.Response.Write("</script>");不知道这样表达清楚了吗?