JSFiddle wrap in onLoad?

前端 未结 3 1414
无人及你
无人及你 2020-12-17 01:01

I\'m trying to understand how JSFiddle \'wraps\' code in \'onLoad\' based on this description: [1]: http://doc.jsfiddle.net/basic/introduction.html#javascript. I\'ve seen on

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 01:27

    It makes a new iframe to run your code in.

    For the onload, they just put all your code in

    window.onload = function () {
        // your code here
    };
    

    You can see this if you inspect the

提交回复
热议问题