We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用modjs异步加载文件: 欲加载的文件列表:['template', '$'] 其中jquery在没有使用define包裹的情况下,mod也能正常把jquery文件插入到dom节点中,但问题是此时的callback是没有运行的,也没有任何报错提示 仅仅是因为代码中if (0 == needNum--)值不相同,是jquery没有使用mod的define函数导致, 在此种情况下建议mod进行一个判断,至少给一个console报错提示, 此时不是异步加载的文件没有加载完毕,而是因为加载的文件不符合define包裹条件而没有执行正常callback。 这对于代码调试来说很有必要!!!
if (0 == needNum--)
配置 fis.hook('commonjs', { paths: { $: 'static/lib/jquery.min.js' } }); ... //异步加载 require(['template', '$'], function(template, jq){ console.log(template({'name': 'abc'})); console.log(jq); }, function(err){ console.log(arguments); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用modjs异步加载文件:
欲加载的文件列表:['template', '$']
其中jquery在没有使用define包裹的情况下,mod也能正常把jquery文件插入到dom节点中,但问题是此时的callback是没有运行的,也没有任何报错提示
仅仅是因为代码中
if (0 == needNum--)
值不相同,是jquery没有使用mod的define函数导致,在此种情况下建议mod进行一个判断,至少给一个console报错提示,
此时不是异步加载的文件没有加载完毕,而是因为加载的文件不符合define包裹条件而没有执行正常callback。
这对于代码调试来说很有必要!!!
The text was updated successfully, but these errors were encountered: