简体   繁体   English

为什么我的nextjs项目中onLoad里面的function没有执行

[英]Why does the function inside onLoad not execute in my nextjs project

I was learning nextjs on nextjs.org and did what I read on the tutorial but it doesn't work.我在 nextjs.org 上学习 nextjs 并做了我在教程中阅读的内容,但它不起作用。 ....why is the function inside onLoad not executing? ....为什么 onLoad 里面的 function 没有执行?

 import Link from 'next/link'; import Head from 'next/head'; import Script from 'next/script'; const FirstPost = () => { return ( < div > < Head > < title > BlogPost < /title> < Script src = "https://connect.facebook.net/en_US/sdk.js" strategy = "lazyOnload" onLoad = { () => { console.log("script loaded successfully"); } } /> < /Head> < h3 > first blog post in my next.js project < /h3> < Link href = "/" > < h2 > Go home < /h2></Link > < /div> ) } export default FirstPost;

本文暂无回复,试试以下方法:

为什么我的nextjs项目中onLoad里面的function没有执行

暂无
暂无

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

相关问题 在计时器内执行onload $(function(){},并将参数传递给它 - Execute onload $(function () {} inside a timer, and pass parameter to it 为什么我的加载 function 不工作? - Why is my onload function not working? 为什么我的函数在遇到返回后执行剩余的代码(返回两个循环内部) - Why does my function execute remaining code after encountering a return (return inside of two loops) 如何在另一个内部具有onload函数的函数执行? - How to execute a function after another one that has an onload function inside it? 为什么我的onload函数无法在JavaScript中使用? - Why my onload function is not working in JavaScript? 为什么我的函数在我的 Promise 回调之前执行? - Why does my function execute before my promise callback? React Native webview的onLoad函数何时执行? - When does the onLoad function of React Native webview execute? 为什么我的代码执行return语句后定义的函数? - Why does my code execute a function defined after the return statement? 为什么我的onload中没有调用我的javascript? - Why does my javascript not get called in my onload? 为什么第二个函数调用阻止第一个函数执行? - Why does my second function call prevent the first one to execute?
 
粤ICP备18138465号  © 2020-2023 STACKOOM.COM