Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.log before DOMContentLoad not shown in console panel #40

Closed
modten opened this issue Jul 31, 2016 · 1 comment
Closed

console.log before DOMContentLoad not shown in console panel #40

modten opened this issue Jul 31, 2016 · 1 comment

Comments

@modten
Copy link

modten commented Jul 31, 2016

<script type="text/javascript" src="http://localhost:8082/console.io.js"></script>
<script>
// not work
console.log(123456)
$(function() {
    // this works
    console.log(456789)
})
</script>

EventEmitter.prototype.emit = function (name) {
    if (!this.$events) {

        // Just return will lose events. using setTimeout or queue to ensure the event truly emitted
        var _this = this;
        var _arguments = arguments;
        setTimeout(function() {
            EventEmitter.prototype.emit.apply(_this, [].slice.call(_arguments));
        }, 10);

        return false;
    }
}
@nkashyap
Copy link
Owner

Yes, current implementation of console.io works after DOMContentLoad event if fired. It was designed to work with requirejs.

@modten modten closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants