在这种情况下如何使用jquery-modal对话框? [英] How to use jquery-modal dialog box in this situation?

查看:68
本文介绍了在这种情况下如何使用jquery-modal对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在使用tablesorter.js,它依赖于jquery.js文件.现在,我尝试使用模态对话框,该对话框原来取决于jquery-1.9.1.js.由于2个jqueries不能在同一模板上,我如何才能使tablesorter.js和jquery对话框一起工作?如果我删除jquery.js并仅包含jquery-1.9.1.js,我将得到:

I am already using tablesorter.js which is dependent on jquery.js file. Now, I am trying to use the modal dialog which turns out to be dependent on jquery-1.9.1.js. Since 2 jqueries can't be on the same template how can I get both tablesorter.js and jquery dialog to work together? If I remove jquery.js and only include jquery-1.9.1.js, I get:

Uncaught TypeError: Object [object Object] has no method 'tablesorter'

错误.

如果我删除jquery-1.9.1.js并仅包含jquery.js,则会收到以下错误:

And if I remove jquery-1.9.1.js and include only jquery.js then I get the following error:

Uncaught TypeError: Object #<Object> has no method 'dialog' 

我正在这样使用Javascript和CSS:

I am using Javascript and css like this:

<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery-latest.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery.tablesorter.js"></script>

 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

推荐答案

您的代码

<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery-latest.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery.tablesorter.js"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

包含两个jquery库.

Contains two jquery libraries.

<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery-latest.js"></script>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>

选择一个.试试这个

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}/js/jquery.tablesorter.js"></script>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

如果再次发生错误,请尝试发布其他代码.

If an error is occured again then try to post additional code.

这篇关于在这种情况下如何使用jquery-modal对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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