JavaScript 后调用的 js 总是不执行?

ripple · April 11, 2012 · Last by ripple replied at April 11, 2012 · 2774 hits
jQuery(document).ready ->
  maps()
  plot()

这两个函数调用都很简单,就是第一个用了 google maps,第二个用了 highcharts 画个图 现在这两个总是先调用的那个起作用,后调用的就不起作用,maps 和 plot 所在的文件,经查看是在浏览器端加载到了的,请问这种问题,可能是那里问题,从哪里查起?

断点调试吧,在 maps() 那里设置一个断点,单步调试。

#1 楼 @daqing 多谢,找到原因了,因为这两个函数在两个页面使用,刚刚使用了 content_for 做了选择性加载。在 plot 页面的时候 maps 由于没有加载,出现未定义错误,停止了 plot() 的调用

You need to Sign in before reply, if you don't have an account, please Sign up first.