function addForm(elem, x) {
var form = $("<form/>");
- form.submit(function(){return false;});
+ form.submit(function(event){event.preventDefault();});
var fieldset = $("<fieldset/>");
form.append(fieldset);
if ($(x).find("title").length > 0)
}
}
-function runCommand() {
+function runCommand(event) {
cmdNode = $(this).attr("id"); // Save node of executed command (in global var)
var execIQ = $iq({ type: "set", to: queryJID, id: connection.getUniqueId() })
.c("command", { xmlns: Strophe.NS.ADHOC, node: cmdNode, action: "execute" });
sessionid = $(result).find("command").attr("sessionid");
displayResult(result);
});
+ event.preventDefault();
}
function getCommandNodes() {
connection.sendIQ(nodesIQ, function(result) {
$('#output').append("<ul id='items'></ul>");
$(result).find("item").each(function(index, e) {
- item = $("<li id='" + $(e).attr("node") + "'>" + $(e).attr("name") + "</li>").bind("click", runCommand);
+ link = $("<a href='#' id='" + $(e).attr("node") + "'>" + $(e).attr("name") + "</a>").click(runCommand)
+ item = $("<li></li>").append(link);
$("#items").append(item);
});
});
jid.show();
$('label').show();
$('#output').empty();
- return false;
}
function showDisconnect() {
pass.hide();
jid.hide();
$('#cred label').hide();
- return false;
}
$(document).ready(function () {
$("#log").toggle();
});
- $('#cred').bind('submit', function () {
+ $('#cred').bind('submit', function (event) {
var button = $('#connect').get(0);
var jid = $('#jid');
var pass = $('#pass');
} else {
connection.disconnect();
}
- return false;
+ event.preventDefault();
});
- $('#queryForm').bind('submit', function () {
+ $('#queryForm').bind('submit', function (event) {
queryJID = $('#queryJID').val();
checkFeatures();
- return false;
+ event.preventDefault();
});
});