I’m running into an Uncaught Type Error when attempting to run the AJAX-driven Entry Form code from the ExpressionEngine docs.
http://ellislab.com/expressionengine/user-guide/modules/safecracker/usage.html
Uncaught TypeError: Object [object Object] has no method 'ajaxForm'Using the inspector Firefox, the error is expanded upon somewhat to:
Error: $("#publishForm").ajaxForm is not a function
Line: 14This is the code of my template, as you’ll see it’s almost identical to what is seen in the documentation:
<html>
<head>
[script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"][/script]
[script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"][/script]
[script src="{site_url}assets/v3/js/jquery.form.js" type="text/javascript"][/script]
[removed]
$(document).ready(function(){
$('#publishForm').ajaxForm({
dataType: 'json',
success: function(data) {
if (data.success) {
alert('You successfully added a new entry with entry_id '+data.entry_id)
} else {
alert〈'Failed with the following errors: '+data.errors.join(', '));
}
}
}〉;
});
[removed]
</head>
<body>
{exp:safecracker channel="contributors_active" return="safecracker/ENTRY_ID/" json="yes"}
<label for="title">Title</label>
<input type="text" name="title" id="title" size="50">
<label for="url_title">URL Title</label>
<input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
<label for="entry_date">Date</label>
<input type="text" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="25" />
<input type="submit" name="submit" value="Submit" />
{/exp:safecracker}
</body>
</html>This is with ExpressionEngine 2.2.1 (Build 20110705).