加载外部js文件到bootstrap模态框
load external js file into bootstrap modal box
我需要显示谷歌地图在引导模式框。我加载谷歌地图API从谷歌网站在我的页面和模态框工作。像这样:
<script src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
HTML: <a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a>
现在,我需要加载谷歌地图api(.JS File
/Libraries
)从url后点击链接(启动模态)的模态框。
如果你正在使用jQuery,那么你可以使用jQuery.getScript()
方法:http://api.jquery.com/jquery.getscript/
基本用法:
$.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {
console.log( data ); // Data returned
console.log( textStatus ); // Success
console.log( jqxhr.status ); // 200
console.log( "Load was performed." );
});
相关文章:
- 获取表单值并在提交时将其传递给Bootstrap模态
- Bootstrap模态主体:Json在上传Codeigniter后刷新
- Bootstrap 模态填充了相同的单个值 - Meteor+React
- Twitter Bootstrap 模态背景不会覆盖 iPad 上的整个屏幕
- ASP.NET Bootstrap 模态作为 JavaScript 确认
- AngularJS UI Bootstrap 模态无法从作用域执行函数
- React-Bootstrap 模态表单条目
- Bootstrap模态会在第二个打开模态时自动添加一个边距
- 将变量传递到Bootstrap模态中
- Bootstrap模态形式获胜't提交淘汰赛's提交绑定
- react bootstrap模态-我如何让它显示出来
- 使用jquery将多个items变量传递到Bootstrap模态中
- 隐藏Angular Bootstrap模态而不是关闭
- 如何从AngularJS正确打开和关闭Bootstrap模态
- 将图像和时尚文本传递到Bootstrap模态
- Bootstrap模态-打开元素的奇怪位置
- 修改默认值“;驳回“;Bootstrap模态的行为
- 将JSON数据加载到Bootstrap模态中
- 我如何通过javascript调用时传递数据到Bootstrap模态
- 模态体不会出现在bootstrap模态中