警报截断我的数据,我该如何查看?

时间:2012-06-01 18:20:02

标签: javascript

警告()上有最大长度吗?

如果是这样,有办法克服它...不同的工具有更大的最大长度?

这是警报的大规模输出...注释最后被截断。截断的内容在浏览器中呈现,因此我知道它就在那里。

|<!--p|2--><!--FRAMEWORK
-->
    <div id="Ba">
      <div id="Ba1">

<!--ACCOUNT
--->

<div id="account">
  <img id="picture" class="b" src="foo/images/generic_small.jpg" alt="">
  </img>
  <div id="wrap_menu_new">
    <p id="top_new">
      Test Account    </p>
    <div id="wrap_drop_down_new">
      <p id="signout_button" class="drop_down_new">Sign Out
      </p>
      <p id="settings_button" class="drop_down_new">Settings
      </p>
    </div>
  </div>
</div>

<!--FRAMEWORK
--->

      </div>
    </div>
    <div id="Bb">
      <div id="Bb1">

<!--BOOKMARKS 
--->

<div id="bookmark_hold">
  <form id="bookmark" method="post" name="bookmark">
    <div id="bookmark_url_wrap">
      <input id="bookmark_input_url" name="url" type="text" maxlength="2048" class="bookmark">
        <p id="bookmark_label_url">Url
        </p>
      </input>
    </div>
    <div id="bookmark_title_wrap">
      <input id="bookmark_input_title" name="title" type="text" maxlength="32" class="bookmark">
        <p id="bookmark_label_title">Title
        </p>
      </input>
    </div>
    <div id="bookmark_tag_wrap">
      <input id="bookmark_input_tag" name="tag" type="text" maxlength="8" class="bookmark">
        <p id="bookmark_label_tag">Tag
        </p>
      </input>
    </div>        
    <input type="hidden" name="domain" value="not_domain">
    </input>
    <input type="hidden" name="favicon" value="not_favicon">
    </input>
    <p id="bookmark_flip_button">Delete
    </p>
    <p id="bookmark_add_button">Add
    </p>
    <div id="bookmark_response" class="response">
    </div>
  </form>
  <div id="tag_bookmark_fill">
    <div id="tag_fill">

    <!--TAG FILL 
    -->

    </div>
    <div id="space">
    </div>
    <div id="bookmark_fill">

    <!--BOOKMARK FILL 
    -->

    </div>
  </div>
</div>

<!--TWEETS 
-->

<div id="tweet_hold">
  <form id="tweet" method="post" name="tweet">
    <div id="tweet_input_wrap">
      <input id="tweet_input" name="tweet" type="text" maxlength="40">
        <p id="tweet_label">Comment
        </p>
      </input>
    </div>
    <p id="tweet_button" href="javascript:void(0)">Share
    </p>
    <div id="tweet_response" class="response">
    </div>
    <div id="tweet_fill">
      <!--TWEET FILL 
      -->
    </div>
  </form>
</div>

<!--SETTINGS
-->

<form id="privacy">

  <input type="radio" id="radio1" name="rdo">
  <label for="radio1"></label>  
  <p class="privacy_title">Normal</p>
  <p class="privacy_content">Your bookmarks are posted to the feed.</p>

  <input type="radio" id="radio2" name="rdo">
  <label for="radio2"></label>    
  <p class="privacy_title">Private</p>
  <p class="privacy_content">Your bookmarks are not posted to the feed.</p>

<!--
  <input type="radio" id="radio3" name="rdo">
  <label for="radio3"></label>
  <p class="privacy_title">Secret</p>
  <p class="privacy_content">Same as private and all of your data is encrypted using NSA approved algorithms.</p>
-->

    <p id="save_button" class="wordpress">Save
    </p>
    <p id="cancel_button" class="wordpress">Cancel
    </p>


</form>

<!--FRAMEWORK 
--->

      </div>
    </div>

<!--DYNAMIC CONTENT 
-->

<script type='text/javascript'>new Arc.Shared().set( 'load_on', 1 );</script><div id='bookmark_data'>[{"id":"1","0":"1","title":"ebay ","1":"ebay ","url":"http:\/\/ebay.com","2":"http:\/\/ebay.com","domain":"ebay.com","3":"ebay.com","tag":"buy","4":"buy","favicon":"http:\/\/www.ebay.com\/favicon.ico","5":"http:\/\/www.ebay.com\/favicon.ico"},{"id":"1","0":"1","title":"gilt","1":"gilt","url":"http:\/\/www.gilt.com\/","2":"http:\/\/www.gilt.com\/","domain":"gilt.com","3":"gilt.com","tag":"buy","4":"buy","favicon":"http:\/\/assets2.giltcdn.com\/assets\/201205231954-27b1d5fa2c\/images\/default\/util\/favicon.ico","5":"http:\/\/assets2.giltcdn.com\/assets\/201205231954-27b1d5fa2c\/images\/default\/util\/favicon.ico"},....

1 个答案:

答案 0 :(得分:7)

是的,浏览器会限制alert条消息的最大长度。

为什么你想要alert()如此庞大的文字?对于调试,您应该使用适用于所有现代浏览器的console.log()或创建div / textarea并在其中显示数据。