Announcement

Collapse
No announcement yet.

Getting a JS function not defined type of error.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Getting a JS function not defined type of error.

    I need to use the jquery-ui library. Things work fine when not in a Shadows page, starting from a blank page.

    I thought JQuery was finally loaded in a default Shadows. Remembered incorrectly? When I attempted to run a function from the UI library the console eluded to JQuery not found, etc.
    Then I added JQuery manually (a CDN) in the header or footer. I've also added as a JS resource.

    The difference now is: the function I'm calling isn't defined or it's not a function. This is usually a conflict with another script or the sequence (order) the scripts are loaded is wrong. Or maybe that there is a second instance of JQuery called?

    The order of scripts, I think, are:

    load JQuery
    load the jquery-ui library
    load the plugin extended library (if there is one) -- none in this case.

    I'm not sure what I'm missing.

    Thanks,

    Scott
    Last edited by ids; 08-09-23, 03:50 PM.
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    I think I'll create a ticket for this. But...

    Some progress, but not really. Getting the same issue as above with the exception that the built-in JQuery is being used and is likely not called more than once.

    The client found the doc snippet on https://docs.miva.com/readytheme-shadows/ under the Javascript section on the page. This method isn't an obvious or intuitive one IMO. Still, it seems to help? However, the problem now moves to the "hook" function instead of the plugin function.

    The console window error:

    jQuery.Deferred exception: $.hook(...) is not a function TypeError: $.hook(...) is not a function
    My conclusion is that the implementation has an error regardless of the plugin. I have confirmed the jquery-ui library is loading in a correct order.

    Does anyone have an example of a working hook function in Shadows? And/Or, how can I get the function to execute when triggered?

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    Comment


      #3
      Just grasping at straws... If jQuery loading is deferred make sure your function is also deferred. This could cause them to fire out of order.
      Ron Frigon
      Jedi Webmaster Obi-Ron Kenobi

      Comment


        #4
        JQuery UI cannot be deferred. The library will not be updated to support it.
        Gordon Currie
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          I'm looking but still don't know how to defer the function.

          But, it doesn't look like jquery-ui needs to be deferred. But, if deferring applies, only the hook function would need to be deferred.

          How would the "hook" function be deferred?

          Scott
          Last edited by ids; 08-10-23, 02:38 PM.
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            UPDATE: this variable has been eliminated.

            Here's a question. I eliminated the one other console error and now I am finding that the functions maybe hanging on the branchkey preview script. Any thoughts on incompatibility?
            I'll have to try this setup in a primary for Shadows somehow.

            Scott

            Update Solution:
            Support helped with the solution.

            Added an additional call of a JQuery CDN just before the closing body tag followed by the jquery-ui library.

            So this works. The enigma is that the JQuery (a later version than shipped with Shadows) is the second instance. Don't know why this isn't a problem. But, everything is firing as expected right now.
            Last edited by ids; 08-11-23, 09:59 AM.
            Need to offer Shipping Insurance?
            Interactive Design Solutions https://www.myids.net
            MivaMerchant Business Partner | Certified MivaMerchant Web Developer
            Competitive Rates, Custom Modules and Integrations, Store Integration
            AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
            My T-shirt Collection is mostly MivaCon T-shirts!!

            Comment

            Working...
            X