There isn’t an element on your page with the id “mainContent” when your callback is being executed.
In the line:
document.getElementById("mainContent").appendChild(p);
the section document.getElementById("mainContent")
is returning null
Related Posts:
- Cross-Origin Read Blocking (CORB)
- syntax error: unexpected token <
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- ajax jquery simple get request
- jQuery get textarea text
- Response to preflight request doesn’t pass access control check
- jQuery AJAX cross domain
- Send POST data using XMLHttpRequest
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- What does on() in JavaScript do?
- jQuery AJAX submit form
- jQuery Ajax File Upload
- How can I upload files asynchronously with jQuery?
- Adding images to a Bootstrap Carousel with AJAX
- AJAX response error: net::ERR_EMPTY_RESPONSE
- Disable same origin policy in Chrome
- Access Control Request Headers, is added to header in AJAX request with jQuery
- React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
- XMLHttpRequest status 0 (responseText is empty)
- Basic Ajax send/receive with node.js
- Execute PHP function with onclick
- JSON.parse() not working
- jQuery Ajax POST example with PHP
- Refresh/reload the content in Div using jquery/ajax
- How does AJAX work?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- Scroll to bottom of div?
- How to manage a redirect request after a jQuery Ajax call
- How to allow CORS in react.js?
- FormData append not working
- Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined
- Download a file by jQuery.Ajax
- What is ‘xmlhttp.setRequestHeader();’ and in which situations is it used?
- “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
- Ajax success function
- JAX post error : Refused to set unsafe header “Connection”
- AngularJS POST Fails: Response for preflight has invalid HTTP status code 404
- $http.get(…).success is not a function
- Adding wp_ajax to a theme outside functions.php (on specific template page)
- Does wp_localize_script call a Javascript Function or Simply Pass PHP Parameters to It
- How to make wordpress URLS google friendly for ajax driven sites?
- AJAX not Working with php as supposed
- addEventListener vs onclick
- How do I check if an array includes a value in JavaScript?
- JavaScript document.getElementById().value logs empty value
- window.onload vs document.onload
- Fetch: POST JSON data
- JavaScript hide/show element
- Copy array by value
- Compare two dates with JavaScript
- ReferenceError: fetch is not defined
- How to import image (.svg, .png ) in a React Component
- How do I embed PHP code in JavaScript?
- Make javascript alert Yes/No Instead of Ok/Cancel
- How to create a dialog with “yes” and “no” options
- How to handle the `onKeyPress` event in ReactJS?
- ES6: Create Strings using Template Literals – Freecodecamp
- Youtube api – stop video
- Uncaught TypeError: Cannot read property ‘msie’ of undefined – jQuery tools
- How do I convert an integer to binary in JavaScript?
- What does window.jQuery and window.$ mean?
- How to simulate a click with JavaScript?
- This.props.dispatch not a function – React-Redux
- this vs $(this)
- “google is not defined” when using Google Maps V3 in Firefox remotely
- how to call a onclick function in tag?
- How to sort an array of integers correctly
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- How can I check whether a radio button is selected with JavaScript?
- typescript – cloning object
- What is the equivalent of Java’s System.out.println() in Javascript?
- How can I exit from a javascript function? [duplicate]
- Register and enqueue conditional (browser-specific) javascript files?
- Implementing Isomorphic JavaScript (React JS) in WordPress?
- Refused to execute script from ‘***’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled
- Why is this gutenberg custom format button only available from the toolbar as a dropdown?
- WordPress problem with htmlentities
- VB.net and WordPress
- Gutenberg passing block attributes to component in ES6/ESNext
- WP REST API Post Status Using JavaScript
- How to prevent those PHP variables from being cached on WordPress?
- wp.template() returns tags in Ajax response
- How to load wp_editor via AJAX
- How do you filter the list of states when country is selected? [closed]
- How to move core js files into the footer
- Building a Featured Gallery component for Gutenberg
- Suddenly extra hex string in tags
- Retrieving data about comments and likes
- Including Styles and JS files to work ON my plugin interface
- Linking wp_enqueue can’t find the javascript file (adds “?ver=x.x.x” to the src)
- Is there some jQuery conflict here?
- Load more posts using AJAX based on posts inside WP_Query
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- Javascript working on jsfiddle but not wordpress site?
- Drodown list return issue
- How to safely pass post_id and user_id via AJAX to the backend (prevent user from changing it via JS)?
- Spans in gutenberg
- Get a default customizeAction text for a section using Customizer JS API
- Put dynamic Javascript in header after doing operations