• Resolved digdug5

    (@digdug5)


    jquery-migrate.min.js?ver=3.3.2:2 JQMIGRATE: Migrate is installed, version 3.3.2
    jquery.min.js?ver=3.6.0:2 jQuery.Deferred exception: Cannot set property ‘onclick’ of null TypeError: Cannot set property ‘onclick’ of null
    at HTMLDocument.<anonymous> (https://www.000000000000000.com/wp-content/plugins/simple-banner/simple-banner.js?ver=2.10.5:56:79)
    at e (https://www.0000000000000.com/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30038)
    at t (https://www.00000000000000.com/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30340) undefined
    S.Deferred.exceptionHook @ jquery.min.js?ver=3.6.0:2
    t @ jquery.min.js?ver=3.6.0:2
    setTimeout (async)
    (anonymous) @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    fire @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    ready @ jquery.min.js?ver=3.6.0:2
    B @ jquery.min.js?ver=3.6.0:2
    jquery.min.js?ver=3.6.0:2 Uncaught TypeError: Cannot set property ‘onclick’ of null
    at HTMLDocument.<anonymous> (simple-banner.js?ver=2.10.5:56)
    at e (jquery.min.js?ver=3.6.0:2)
    at t (jquery.min.js?ver=3.6.0:2)
    (anonymous) @ simple-banner.js?ver=2.10.5:56
    e @ jquery.min.js?ver=3.6.0:2
    t @ jquery.min.js?ver=3.6.0:2
    setTimeout (async)
    S.readyException @ jquery.min.js?ver=3.6.0:2
    (anonymous) @ jquery.min.js?ver=3.6.0:2
    e @ jquery.min.js?ver=3.6.0:2
    t @ jquery.min.js?ver=3.6.0:2
    setTimeout (async)
    (anonymous) @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    fire @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    t @ jquery.min.js?ver=3.6.0:2
    setTimeout (async)
    (anonymous) @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    fire @ jquery.min.js?ver=3.6.0:2
    c @ jquery.min.js?ver=3.6.0:2
    fireWith @ jquery.min.js?ver=3.6.0:2
    ready @ jquery.min.js?ver=3.6.0:2
    B @ jquery.min.js?ver=3.6.0:2
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
    Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author rpetersen29

    (@rpetersen29)

    Hi @digdug5
    I’m not sure exactly what your code is doing, but you’ll need to wait for the banner to load on the DOM. You may be able to fix this by enabling the wp_body_open feature if your theme uses that wordpress hook. Otherwise the Banner loads via a script so you’ll need to add a settimeout to your function that calls if the element is not found on screen.

    Thread Starter digdug5

    (@digdug5)

    Thanks the only way I can get rid of the onclick error is to disable the close button option.

    Plugin Author rpetersen29

    (@rpetersen29)

    Can you describe what your onclick action is doing?

    Thread Starter digdug5

    (@digdug5)

    Its the onclick event below thats causing the “Cannot set property ‘onclick’ of null at HTMLDocument.”

    if (simpleBannerVisible) {
    var sbCookie = “simplebannerclosed”;
    if (simpleBannerScriptParams.close_button_enabled){
    if (getCookie(sbCookie) === “true”) {
    closeBanner();
    } else {
    var expiration = parseInt(simpleBannerScriptParams.close_button_expiration) || 30;
    document.getElementById(“simple-banner-close-button”).onclick = function() {
    closeBanner();
    setCookie(sbCookie, “true”, expiration);
    };
    }

    Plugin Author rpetersen29

    (@rpetersen29)

    Oh interesting. Javascript runs synchronously so that shouldn’t be happening. Does it only happen when your banner text is blank?

    Thread Starter digdug5

    (@digdug5)

    Yeah it seems like it may be related to the text being blank

    Plugin Author rpetersen29

    (@rpetersen29)

    Okay, so it’s not a huge issue considering the banner won’t show if there’s no text. That error is simply due to the fact that there’s no element to attach the onclick action to. And since there’s no banner shown then that’s fine. Obviously I don’t want to just be throwing a bunch of needless errors in the console so I’ll put out a fix soon. But in the meantime there’s nothing to worry about.

    Also getting this same error. We were not showing a banner but still get the error. We will disable the plugin until the fix is out. Thanks.

    https://www.manateepao.com/wp-content/plugins/simple-banner/simple-banner.js?ver=2.10.5

    Uncaught TypeError: Cannot set property ‘onclick’ of null
    at HTMLDocument.<anonymous> (simple-banner.js?ver=2.10.5:56)
    at e (jquery.min.js?ver=3.6.0:2)
    at t (jquery.min.js?ver=3.6.0:2)

    Plugin Author rpetersen29

    (@rpetersen29)

    @capegreg @digdug5 Issue has been fixed in v2.10.6

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Console Error: Cannot set property ‘onclick’’ is closed to new replies.