jQuery .ready()等价于d3js? [英] jquery .ready() equivalent in d3js?

查看:75
本文介绍了jQuery .ready()等价于d3js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我在丑陋为文件&之后添加了HTML <head>上的所有JavaScript.使用这些jquery函数检查文档是否准备就绪

currently i am adding all javascript at HTML <head> after uglying as file & using these jquery functions to check document ready

$( document ).ready(function() {}); OR $(function() {});

是否有等效的d3js可以删除这些jquery函数的使用?

is there any d3js equivalent to remove using of these jquery functions ?

推荐答案

A

您可以简单地将<script>标签放在body标签的底部.

A

You can simply put the <script> tag at the bottom of the body tag.

您可以添加DOMContentLoaded事件并将d3js代码插入其中.

you can add the DOMContentLoaded event and insert your d3js code inside.

document.addEventListener("DOMContentLoaded", function(e) {
   /* Your D3.js here */
  });

直接回答

D3.js库中的jQuery函数没有,上面编写的代码段也可以使用.

Direct Answer

There is no equivalent to the jQuery function in the D3.js library, the snippet written above will work as well.

这篇关于jQuery .ready()等价于d3js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆