ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SafeCracker Throwing JavaScript Errors

April 21, 2011 6:37pm

Subscribe [5]
  • #1 / Apr 21, 2011 6:37pm

    LucasHibbard

    61 posts

    When ever I add a SafeCracker from to any of my templates I receive a JavaScript error that says “EE is not defined”.  I have tried removing just the SafeCracker from the page to make sure that it was that causing the issue, and it was.  I have also set include_jquery to no, thinking that maybe there was a conflict with the jQuery on my site and the jQuery that comes with SafeCracker.  I am still receiving the errors.  On top of this, the SafeCracker form does not even show on the page.  Could someone please help me with this issue?  I would very much appreciate any assistance I could get.

    Thank you,
    Lucas

  • #2 / Apr 22, 2011 1:04pm

    Brandon Jones

    5500 posts

    Lucas,

    What version of EE and SafeCracker are you using? SafeCracker 2 may not work with older versions of EE.

  • #3 / Apr 22, 2011 1:46pm

    LucasHibbard

    61 posts

    ExpressionEngine: Version 2.1.3 Build 20101220
    SafeCracker: 2.0

    Thanks.

  • #4 / Apr 22, 2011 5:09pm

    Sue Crocker

    26054 posts

    Hi, Lucas. If you create a new template with just the SafeCracker code in it (no additional javascript, etc.) does that work?

  • #5 / Apr 22, 2011 5:22pm

    LucasHibbard

    61 posts

    Hi Sue,

    Yes, even with a completely stripped down template I receive the JavaScript errors.  Still saying “EE is not defined”.  Thanks for your help.

  • #6 / Apr 23, 2011 3:11pm

    Greg Salt

    3988 posts

    Hi Lucas,

    Does this happen with all browsers or just one? If just one, which one? Is this site a local install or a remote one on a professionally hosted server?

    Cheers

    Greg

  • #7 / Apr 27, 2011 4:47pm

    LucasHibbard

    61 posts

    Hey Greg,

    It looks like this is happening in all browsers except for FireFox4.  Also, this is on a MediaTemple server, so I don’t think it’s an issue with my web host.

    Thanks,
    Lucas

  • #8 / Apr 28, 2011 10:34am

    Sue Crocker

    26054 posts

    Hi, Lucas. I have several installs on MediaTemple GS, and routinely test with FireFox 4 on my Mac.

    Can you post your SC form here? I’d like to see if I can replicate on my installs.

  • #9 / Apr 28, 2011 12:57pm

    LucasHibbard

    61 posts

    Hey Sue,

    Here is the code that you requested:

    {exp:channel:entries channel="dml_entries" limit="1"}
                            {exp:safecracker channel="dml_entries" url_title="{url_title}" return="{relative_url}" }
                        <div class="cb-data">
                            <div class="article-data">
                                <h2>{title}</h2>
    <p>                            <div class="article-meta"><br />
                                    <ul><br />
                                        <li>Rating: {site_url}ui/images/stars.jpg</li><br />
                                        <li>Date: <strong>{if doc_date != ""}{doc_date format="%m/%d/%Y"}{if:else}{entry_date format="%m/%d/%Y"}{/if}</strong></li><br />
                                        <li>Views: <strong></strong></li><br />
                                        <li>Doc Type: <strong>{doc_type}</strong></li><br />
                                    </ul><br />
                                    <ul><br />
                                        <li>Jurisdiction:<br />
                                            {categories}<br />
                                                <strong>{category_name}</strong><br />
                                            {/categories}<br />
                                        </li><br />
                                        <li>Submitted by: <a href="http://{member_path=member/index}">{author}</a></li><br />
                                    </ul><br />
                                </div><br />
                                {custom_fields}<br />
                                <div class="article-copy"><br />
                                    <div><br />
                                        {if textarea}<br />
                                        <br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            {formatting_buttons}<br />
                                            <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="124" rows="{rows}">{field_data}</textarea><br />
                                        <br />
                                        {/if}<br />
                                        {if textinput}<br />
                                        <br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            <input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50"><br />
                                        <br />
                                        {/if}<br />
                                        {if date}<br />
                                        <br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            <input type="text" id="{field_name}" name="{field_name}" {if "{field_data}" != "1969-12-31 11:00 AM"}value="{field_data}"{if:else}value=""{/if} maxlength="{maxlength}" size="50"><br />
                                        <br />
                                        {/if}<br />
                                        {if checkbox}<br />
                                        <br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            {options}{option_value} <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked} /><br />
                                            {/options}<br />
                                        <br />
                                        {/if}<br />
                                        {if radio}<br />
                                        <br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            {options}{option_value} <input type="radio" id="{field_name}" name="{field_name}" value="{option_value}"{checked} /><br />
                                            {/options}<br />
                                        <br />
                                        {/if}<br />
                                        {if tagger}<br />
                                            <label for="{field_name}">{field_label}</label><br />
                                            {display_field}<br />
                                        {/if}<br />
                                    </div><br />
                                </div><br />
                                {/custom_fields}<br />
                                <input type="submit" name="submit" value="Submit" /><br />
                            </div><br />
                        </div><br />
                            {/exp:safecracker}<br />
                        {/exp:channel:entries}

    Just to clarify, the problem that I am having is not happening in FF4, but does seem to be working in other browsers (ex: FF3.6). 

    Please let me know if you need more information.  Thank you so much for you assistance.

    Thanks,
    Lucas

  • #10 / Apr 29, 2011 3:47pm

    Brandon Jones

    5500 posts

    LucasHibbard,

    Using Firebug’s Net tab, are you seeing any requests error out? And the code you posted is the only code in the template, correct (no other scripts are being loaded?)

  • #11 / May 02, 2011 10:46am

    LucasHibbard

    61 posts

    Brandon,

    Yes, this is the only script that I am loading on this page.  When I check out the ‘Net’ tab on Firebug, I am not seeing any thing erroring out, but when I am still not seeing the form and I am receiving 3 errors on the ‘Console’ tab of Firebug.  These are the errors I’m receiving:

    EE is not defined
    [Break On This Error] r(j);q(j);b.eq(0).data(“scrollable”).f…point_request=function(b,c,d){if(!d&&

    EE is not defined
    [Break On This Error] <style type="text/css">.hasDatepicker{...;};$.createDatepickerTime();[removed]

    EE is not defined
    [Break On This Error] $.datepicker.setDefaults({dateFormat:$.datepicker.W3C+EE.date_obj_time});

    Again, this is happening in all browsers except for FireFox4.  Thank you for your help.

    Thanks,
    Lucas

  • #12 / May 02, 2011 6:59pm

    Brandon Jones

    5500 posts

    Lucas,

    Can you try completely replacing your /themes/javascript folder with that from the current EE download package?

  • #13 / May 03, 2011 12:04pm

    LucasHibbard

    61 posts

    Hi Brandon,

    I have replaced the entire folder that you indicated, but I am still receiving the errors that I was before.  Do you have any other ideas?  Any help is very much appreciated.

    Thank you,
    Lucas

  • #14 / May 03, 2011 5:41pm

    Kevin Smith

    4784 posts

    Hey Lucas—

    I suspect you’re having the same problem Kelly had over in this thread, a jQuery conflict caused by loading jQuery again after SafeCracker loads it the first time.

    Check the solution I posted there and see if that fixes it. Let me know how it works out!

    Kevin

  • #15 / May 04, 2011 5:04am

    narration

    773 posts

    Just so you know, that your work is early being noticed, Kevin.

    Welcome aboard.

    Regards,
    Clive

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases