How to check if Twitter bootstrap is loaded?

前端 未结 9 873
礼貌的吻别
礼貌的吻别 2020-12-07 14:32

How can I check whether there is a bootstrap.js loaded on page (a file bootstrap.js may be compiled into another big JS file)?

9条回答
  •  抹茶落季
    2020-12-07 14:33

    if (typeof([?])=='undefined') { /*bootstrap is not loaded */}

    where [?] would be any object or namespace which is defined inside the JS file itself.

    The concept of "including" doesn't exist in javascript.

提交回复
热议问题