How many characters allowed in an alert box in JavaScript

前端 未结 4 2031
一整个雨季
一整个雨季 2020-12-07 01:04

Does anyone know what is the maximum number of characters you can display in an alert box?

I\'m returning an error alert to the user with details for each of the erro

4条回答
  •  鱼传尺愫
    2020-12-07 01:28

    After looking at your code, i see no reason why you even need alerts. If you're validating PHP output, just dump a couple HTML comments in your code and view source:

    
    

    If you must be using JavaScript, consider using the built-in console to handle your debugging as it wont block your scripts. Firebug for Firefox is the best set of dev tools IMHO.

    console.log();
    

    As far as alert is concerned. I don't believe there's a specified limit to the length of the string it can handle as the mozilla docs list it as DOM Level 0. Not part of any standard.

提交回复
热议问题