我正在使用pinax开发一个网站.在我的一个模板中,我试图打开一个简单的jquery对话框.但是我一直得到"Dialog not a function"javascript错误.我使用的是jquery 1.2.6和jquery-ui 1.6.我的javascript和HTML如下:
<html>
<head>
<link type="text/css" href="/site_media/smoothness/ui.all.css" rel="stylesheet" />
<script src="/site_media/jquery.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.core.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.draggable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.resizeable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.dialog.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#dialogbox').dialog();
});
</script>
</head>
<body>
<div id="dialogbox" title="dialog title">
<p>Test dialog</p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
有人可以解释为什么会这样吗?
我正在编写一个简单的绘图应用程序来了解HTML 5画布.问题是我似乎无法在canvas元素中获得正确的鼠标位置.我已经查看了stackoverflow上的其他问题,就像在这里用javascript在画布中获取鼠标位置来解决这个问题,但是他们的解决方案没有好像在帮助我.
这是我的代码:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
#test {
border: solid black 1px;
width: 500px;
height: 500px;
}
</style>
<script type="text/javascript">
$(function(){
var canvas=document.getElementById('test');
if(canvas.getContext){
var ctx =canvas.getContext('2d');
var draw = false;
ctx.strokeStyle = "rgb(200,0,0)";
ctx.lineWidth = 3;
ctx.lineCap = "round";
$('#test').mousedown(function(){draw=true;});
$('#test').mouseup(function(){draw=false;});
$('#test').mousemove(function(e){
if(draw){
var x , y;
x = e.layerX;
y = e.layerY;
ctx.moveTo(x,y);
ctx.lineTo(x+1,y+1);
ctx.stroke();
}
});
}
});
</script>
</head>
<body> …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用pinax开发一个网站.要使用djapian索引模型,我一直在尝试将"manage.py index"作为cron作业运行,但不断出现pinax错误."错误:没有模块命名通知".但是,当我从shell运行它时,任务正确执行.我的crontab定义如下:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/mypath/test_project
# m h dom mon dow user command
*/1 * * * * root python /root/mypath/test_project/manage.py index >>/tmp/backup.log 2>&1
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释为什么我收到此错误?
我正在寻找一个独立的工具(对于Windows XP),它从包含DICOM图像的目录生成DICOMDIR文件.我查看了http://www.tomovision.com/products/dicom_dir.htm,但它给了我一个运行时错误.任何人都可以为此目的推荐任何工具吗?