1. <tfoot id='L758s'></tfoot>

      • <bdo id='L758s'></bdo><ul id='L758s'></ul>

      <small id='L758s'></small><noframes id='L758s'>

      <i id='L758s'><tr id='L758s'><dt id='L758s'><q id='L758s'><span id='L758s'><b id='L758s'><form id='L758s'><ins id='L758s'></ins><ul id='L758s'></ul><sub id='L758s'></sub></form><legend id='L758s'></legend><bdo id='L758s'><pre id='L758s'><center id='L758s'></center></pre></bdo></b><th id='L758s'></th></span></q></dt></tr></i><div id='L758s'><tfoot id='L758s'></tfoot><dl id='L758s'><fieldset id='L758s'></fieldset></dl></div>
        <legend id='L758s'><style id='L758s'><dir id='L758s'><q id='L758s'></q></dir></style></legend>

        返回和换行符?

        return and newlines?(返回和换行符?)
            <bdo id='K5Wtg'></bdo><ul id='K5Wtg'></ul>

            <small id='K5Wtg'></small><noframes id='K5Wtg'>

            1. <tfoot id='K5Wtg'></tfoot>

                <tbody id='K5Wtg'></tbody>
              <legend id='K5Wtg'><style id='K5Wtg'><dir id='K5Wtg'><q id='K5Wtg'></q></dir></style></legend>
              <i id='K5Wtg'><tr id='K5Wtg'><dt id='K5Wtg'><q id='K5Wtg'><span id='K5Wtg'><b id='K5Wtg'><form id='K5Wtg'><ins id='K5Wtg'></ins><ul id='K5Wtg'></ul><sub id='K5Wtg'></sub></form><legend id='K5Wtg'></legend><bdo id='K5Wtg'><pre id='K5Wtg'><center id='K5Wtg'></center></pre></bdo></b><th id='K5Wtg'></th></span></q></dt></tr></i><div id='K5Wtg'><tfoot id='K5Wtg'></tfoot><dl id='K5Wtg'><fieldset id='K5Wtg'></fieldset></dl></div>

                  本文介绍了返回和换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我今天搞砸了一些事情,我要返回一个 DOM 树.我想知道是否有办法让代码如下:

                  I was messing around with something today, where I'm returning a DOM tree. I was wondering if there was a way to have the code be like:

                  return
                    '<div id="something"> 
                       <p>Stuff</p> 
                     </div>'
                  

                  代替:

                  return '<div id="something"> 
                       <p>Stuff</p> 
                     </div>'
                  

                  只是出于美学原因 - 第一个看起来更好.我在 Google 上搜索了大约 10 分钟,然后想我应该问问那些比我了解更多的人.

                  just for aesthetic reasons - the first one looks better. I Googled it for about 10 minutes, then figured I ought to just ask those who know more than me.

                  推荐答案

                  不,不是.

                  return后的新行触发分号插入,所以代码相当于:

                  A new line after a return triggers semi-colon insertion, so the code is equivalent to:

                  return;
                    '<div id="something"> 
                       <p>Stuff</p> 
                     </div>';
                  

                  …然后你返回 undefined.

                  这篇关于返回和换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                  <i id='tGDiM'><tr id='tGDiM'><dt id='tGDiM'><q id='tGDiM'><span id='tGDiM'><b id='tGDiM'><form id='tGDiM'><ins id='tGDiM'></ins><ul id='tGDiM'></ul><sub id='tGDiM'></sub></form><legend id='tGDiM'></legend><bdo id='tGDiM'><pre id='tGDiM'><center id='tGDiM'></center></pre></bdo></b><th id='tGDiM'></th></span></q></dt></tr></i><div id='tGDiM'><tfoot id='tGDiM'></tfoot><dl id='tGDiM'><fieldset id='tGDiM'></fieldset></dl></div>

                          <tfoot id='tGDiM'></tfoot>
                            <tbody id='tGDiM'></tbody>
                        1. <legend id='tGDiM'><style id='tGDiM'><dir id='tGDiM'><q id='tGDiM'></q></dir></style></legend>
                        2. <small id='tGDiM'></small><noframes id='tGDiM'>

                            <bdo id='tGDiM'></bdo><ul id='tGDiM'></ul>