输出中缺少空间 [英] Missing space in output

查看:99
本文介绍了输出中缺少空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


可能是您的简单问题。我不明白为什么

的输出类似于


<%=" x"%> <%=" x"%>





" xx" (没有引号)


为什么两个x'之间没有空格?

(当然我可以通过其他方式实现这一点,但是我不明白

为什么会这样。)


-

David H

推荐答案

因为x里面没有空间...

试试:


<%=" x"%> <%=" x"%>


David H写道:
Because "x" doesn''t have a space in it ...
try:

<%=" x "%> <%="x"%>

David H wrote:
你好。

对你来说很简单的问题。我无法理解为什么输出

<%=" x"%> <%=" x"%>



" xx" (没有引号)

为什么两个x'之间没有空格?
(当然我可以通过其他方式实现这一点,但我无法理解
为什么会发生这种情况。)
Hello.

Simple question for you probably. I can''t understand why the output for
something like

<%="x"%> <%="x"%>

is

"xx" (no quotation marks)

Why is there no space between the two x''s?
(Of course I could achieve this in other ways, but I can''t understand
why this happens.)



" Dave Karmens" < SP ************* @ yahoo.ca>在消息中写道

news:Oc ************** @ TK2MSFTNGP09.phx.gbl ...
"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:Oc**************@TK2MSFTNGP09.phx.gbl...
因为x里面没有空间......
尝试:

<%=" x"%> <%=" x"%>
Because "x" doesn''t have a space in it ...
try:

<%=" x "%> <%="x"%>




我相信他会问为什么%>之后的空格在以下<%是

之前忽略。

例如,尽管HTML中有明显的空格

部分代码(在ASP标签之间),这不会在第二个x之前产生任何空格



<%=" x"%> <%=" x"%>


但是,如果您在其中插入任何其他字符,包含

空格,您将看到空格:

<%=" x"%> x<%=" x"%>


这将显示为:

xxx


为什么?我不知道。我想一个解决方案是在ASP标签之间放置一个不间断的

空间,但为什么需要呢?


问候,

Peter Foti



I believe he''s asking why the space after %> and before the following <% is
ignored.
For example, despite the fact that there is clearly a space in the HTML
portion of code (between the ASP tags), this does not produce any whitespace
before the 2nd "x":
<%="x"%> <%="x"%>

However, if you insert any other character in there, surrounded by
whitespace, you will see the spaces:
<%="x"%> x <%="x"%>

This will show as:
x x x

Why? I don''t know. I suppose one solution would be to put a non-breaking
space between the ASP tags, but why is that required?

Regards,
Peter Foti


我最近也是第一次遇到这个问题。我的行是

喜欢:


欢迎<%= sFirstname%> <%= sLastname%>


在一个视图源中,html中显然有一个空格,但它显示为

,如:


欢迎RayCostanzo


为什么?我没有打算弄清楚是什么,所以我只是这样做了:


<%= sFirstname& " " &安培; sLastname%>


一切都很好。所以,如果不出意外,你并不孤单!


Ray在工作中


David H <公顷****** @ msn.com>在消息中写道

news:q9 ******************** @ newsc.telia.net ...
I just ran into this for the first time myself, too, recently. My line was
like:

Welcome <%=sFirstname%> <%=sLastname%>

In a view-source, there was clearly a space in the html, yet it displayed
like:

Welcome RayCostanzo

Why? I didn''t bother trying to figure out what was up, so I just did:

<%=sFirstname & " " & sLastname%>

and all was fine. So, if nothing else, you''re not alone in this!

Ray at work

"David H" <ha******@msn.com> wrote in message
news:q9********************@newsc.telia.net...
你好。

对你来说很简单的问题。我无法理解为什么输出

<%=" x"%> <%=" x"%>



" xx" (没有引号)

为什么两个x'之间没有空格?
(当然我可以通过其他方式实现这一点,但我无法理解
为什么会发生这种情况。)

-
David H
Hello.

Simple question for you probably. I can''t understand why the output for
something like

<%="x"%> <%="x"%>

is

"xx" (no quotation marks)

Why is there no space between the two x''s?
(Of course I could achieve this in other ways, but I can''t understand
why this happens.)

--
David H



这篇关于输出中缺少空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆