简体   繁体   English

未捕获的 promise。 无法设置属性。 onMovieSelect 上 null 的“innerHTML”

[英]Uncaught promise. Cannot set property. 'innerHTML' of null at onMovieSelct

Getting this error whenever I run the web-app.每当我运行网络应用程序时都会出现此错误。 Code is below for JS/HTML.下面是 JS/HTML 的代码。 Summary is defined in my HTML file摘要在我的 HTML 文件中定义

const onMovieSelect = async movie => {
    const response = await axios.get('http://www.omdbapi.com/', {
      params: {
        apikey: 'd9835cc5',
        i: movie.imdbID
      }
    });
      
        **document.querySelector('#summary').innerHTML = movieTemplate(response.data);
      };**


  <div id="summary">
    </div>

Getting this error whenever I run the web-app.每当我运行网络应用程序时都会出现此错误。 Code is below for JS/HTML.下面是 JS/HTML 的代码。 Summary is defined in my HTML file摘要在我的 HTML 文件中定义

const onMovieSelect = async movie => {
    const response = await axios.get('http://www.omdbapi.com/', {
      params: {
        apikey: 'd9835cc5',
        i: movie.imdbID
      }
    });
      
        **document.querySelector('#summary').innerHTML = movieTemplate(response.data);
      };**


  <div id="summary">
    </div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获(承诺)TypeError:无法将属性&#39;innerHTML&#39;设置为null - Uncaught (in promise) TypeError: Cannot set property 'innerHTML' of null 未捕获的TypeError:无法设置null的属性&#39;innerHTML&#39; - Uncaught TypeError: Cannot set property 'innerHTML' of null 未捕获的TypeError:无法将属性&#39;innerHTML&#39;设置为null - Uncaught TypeError: Cannot set property 'innerHTML' of null 未捕获的Typeerror:无法将属性innerHTML设置为null - Uncaught Typeerror: Cannot set property innerHTML of null 未捕获的TypeError:无法将属性&#39;innerHTML&#39;设置为null - Uncaught TypeError: Cannot set property 'innerHTML' of null 未捕获的TypeError:无法将属性&#39;innerHTML&#39;设置为null - Uncaught TypeError: Cannot set property 'innerHTML' of null 未捕获(承诺)TypeError:无法设置 null 的属性“innerHTML” - 我可以在 console.log() 中看到值 - Uncaught (in promise) TypeError: Cannot set property 'innerHTML' of null - I can see value in console.log() 如何解决Uncaught(在promise中),无法在Webcam Media Devices上设置null的属性&#39;innerHTML&#39; - How to solve Uncaught (in promise), Cannot set property 'innerHTML' of null on Webcam Media​Devices 未捕获(承诺)类型错误:无法读取 null 的属性“innerHTML”? - Uncaught (in promise) TypeError: Cannot read property 'innerHTML' of null? 未捕获(承诺中)类型错误:无法设置 null 的属性(设置“innerHTML”) - Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM