0
我目前在Confluence HTML宏內使用jQuery來顯示一個對話框。如何在Confluence中使用jQuery UI?
<input type="text" id="shortName" style="height: 18px; width: 50px;">
<input type="submit" id="submit" value="calendar">
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#calendarDialog").dialog({
modal: true,
autoOpen: false,
height: "600",
width: "800",
draggable: true,
resizeable: true
});
jQuery("#submit").click(
function() {
var emp = jQuery("#shortName").val().replace('.', '');
var url = <some-url>;
var dialogTitle = emp + "'s day calendar";
jQuery("#calendarDialog").dialog("open");
jQuery("#calendarDialog").dialog("option", "title", dialogTitle);
jQuery("#calendarIFrame").attr("src", url);
return false;
});
jQuery("#shortName").focus();
});
</script>
<div id="calendarDialog" style="overflow: none;"><iframe id="calendarIFrame" width="100%" height="99%" frameBorder="0" title="dialogBox"></iframe></div>
我該如何在Confluence中包含jQuery UI的東西?如果我在上面的代碼中引用了jQuery UI(引用http://code.jquery.com/ui/1.9.0/jquery-ui.js),它將打破宏中的jQuery代碼。
請問您是否更具體?什麼語句在'jquery(document).ready(function(){...})'結構中不起作用? –
@ Beetroot-Beetroot,我避免發佈整個代碼,因爲我認爲在這種情況下它是無關緊要的。我們的Confluence自帶jQuery 1.6.x,可能也可能不會發布jQuery UI,我不知道。在我的HTML宏中包含jQuery UI似乎會導致與Confluence或者Confluence中包含的JS庫的衝突。 –
這可能只是使用英語,但你的聲明「如果我在上面的代碼中包含jQuery UI ......」有點令人擔憂。我只是想檢查你是不是在做一些愚蠢的事情。 –