Home >Web Front-end >HTML Tutorial >html splicing problem_html/css_WEB-ITnose
I don’t know much about web development, but I need to modify some asp things. When I spell html, I always make mistakes, sometimes "sometimes' sometimes&", I feel dizzy. I know the main reason is that I am not very good at this aspect. I understand, but the writing style of html and javascript is too "loose" or too loose, unlike C#.
There is a statement that cannot be spelled. Help:
is a statement that dynamically outputs query results. rs is the result. Set
Response.Write"<table align=center bgcolor='#666666' border=0 cellpadding=1 cellspacing=0 ><tbody><td><a href='a.asp?id="&rs("id")&"' target='_blank'><img src="&rs("id")&" border='0' width=160 height=160 onmouseover=showBigImg(<img src="&rs("img")&">) onmouseout=showBigImg() ></a></td></tbody></table><br><a href='a.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a></td>"
onmouseover=showBigImg(<img src="&rs("img")&">) onmouseout=showBigImg()
Response.Write"<table align=center bgcolor=\"#666666\" border=0 cellpadding=1 cellspacing=0 ><tbody><td><a href=\"a.asp?id=\"&rs(\"id\")&\"\" target=\"_blank\"><img src=\"&rs(\"id\")&\" border=\"0\" width=160 height=160 onmouseover=showBigImg(<img src=\"&rs(\"img\")&\">) onmouseout=showBigImg() ></a></td></tbody></table><br><a href=\"a.asp?id=\"&rs(\"id\")&\"\" target=\"blank\">\"&rs(\"name\")&\"</a></td>";
You can define a variable to receive the string... Then output this variable... See where there is a problem
dim a=rs("id");dim b=rs("img");dim c=rs("name");Response.Write "<table align=center bgcolor='#666666' border=0 cellpadding=1 cellspacing=0 ><tbody><td><a href='a.asp?id="+a+"'target='_blank'><img src='' border='0' width=160 height=160 onmouseover=showBigImg(<img src='"+b+"'>) onmouseout=showBigImg() ></a></td></tbody></table><br><a href='a.asp?id="+a+"' target='blank'>"+c+"</a></td>";
The connection of vbscript is &
For example
response.write("870b60f24805d6a55f430c61947111c3"&rs("col")&" 16b28748ea4df4d9c2150843fecfba68")
or
response.write("b350fb13c513d0e7780ea7a547441973"&rs("col")&"16b28748ea4df4d9c2150843fecfba68")
The poster can check the source code of the page and see the difference
'color:red' prints out as single quotes
""color:red""> prints out as single quotes pair of double quotes