I'm using safecracker and getting this error:
Uncaught ReferenceError: EE is not defined
when using safecracker. I tried this solution:
http://ellislab.com/forums/viewthread/197571/P15
(moving jquery to the footer) and it didn't solve the error. I even loaded the safecracker form via ajax after the rest of the page had loaded, and it didn't solve the issue.
I noticed that if I view source, in the form action parameters there's a whole bunch of jquery UI stuff referenced - I'm not using jquery ui, and the form shouldn't need most of this stuff. On chrome, this worked properly without jquery ui, so I'm not sure what this is all about:
?ACT=10&ui=core,widget,mouse,position,draggable,resizable,button,dialog&plugin=scrollable,scrollable.navigator,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1355863708&use_live_url=y"
I tried including jquery ui but that didn't seem to make a difference. I've attached screenshots of the error - you can feel free to check this out to see what's going on:
but keep in mind I'm working on it so it may change. The four screenshots shown below are for two different errors - the first two are when the form is embedded in the template, and I am using my own jquery, and setting include_jquery="no" - the second two are when I use my own jquery, but then load the form via ajax (thus ensuring that the form loads after jquery).
This is my current ee tag for safecracker: {exp:safecracker channel="diy_submissions" return="site/diy_success" include_jquery="no" allow_comments="no" datepicker="no" logged_out_member_id="5" preserve_checkboxes="no"}
I tried removing all the actual form fields and the error still occurs, so I guess you could limit the error to the actual inclusion of safecracker alone, and not to any of the field types used within.
I also put just the form into its own template, allowed it to include jquery, and it loads nothing at all (with no console errors). The source of the code is this:
<html>
<head><title>Test Form</title></head>
<body>
{exp:safecracker channel="diy_submissions" return="site/diy_success" include_jquery="yes" allow_comments="no" datepicker="no" logged_out_member_id="5" preserve_checkboxes="no"}
<p class="prompt_text">
Have a recipe, occasion or project idea that uses Carapelli? <br />
We'd love to showcase it in our gallery.
</p>
<div class="content_detail_content">
<nav class="subnav">
<a class="subnav_link collect active" data-ident="collect" data-count="0">Collect</a>
<a class="subnav_link assemble" data-ident="assemble" data-count="1">Assemble</a>
<a class="subnav_link share lastitem" data-ident="share" data-count="2">Share</a>
</nav>
<div class="project_content_container">
<div class="project_text_section collect active">
<textarea name="submission_collect" value="{submission_collect}">Enter ingredients or supplies needed.</textarea>
</div>
<div class="project_text_section assemble">
<textarea name="submission_assemble" value="{submission_assemble}">Enter project or recipe directions.</textarea>
</div>
<div class="project_text_section share">
<p>
Perfect! Now give it a name, upload a photo of the finished
product and submit your brilliant Carapelli idea!
</p>
</div>
<div class="project_title share">
<label for="title">Name</label>
<input name="title" value="{title}" id="title" type="text" maxlength="100">
</div>
<div class="upload_button collect active">
UPLOAD PHOTO <span class="choose">{field:submission_collect_file}</span>
</div>
<div class="upload_button assemble">
UPLOAD PHOTO <span class="choose">{field:submission_assemble_file}</span>
</div>
<div class="upload_button share">
UPLOAD PHOTO <span class="choose">{field:submission_share_file}</span>
</div>
<div class="next_button">
<span class="next">NEXT STEP</span>
</div>
<div class="submit_button" style="display:none;">
<button name="submit" class="ideas_submit">SUBMIT IDEA<br />
FOR APPROVAL</button>
</div>
</div>
</div>
{/exp:safecracker}
</body>
</html>
$this->EE
singleton correctly.