Announcement

Collapse
No announcement yet.

Running tiny scripts

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

    Running tiny scripts

    I have a teeeeeny little bit of JavaScript (well it's jQuery based if that makes a difference) that I want to run on a specific page, and just one page. I've put it in the page header and footer of the page tempate but it doesn't seem to run.

    #2
    The first thing to check is that Jquery is running and loaded before your script.

    After that, use the browser's inspector tool, the console, and see if there is an error.

    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
      When I run the script from the browser console it does exactly what I'd expect.

      I added the script as an inline script on the User Interface > JavaScript Resource page, and now my cart is giving me a 504 ...

      it seems the 504 is coming from external scripts not loading from their CDNs
      Last edited by cpp-dev; 06-16-20, 08:20 AM.

      Comment


        #4
        I have, and that's where I was not getting the expected results, first.

        Additionally, I'm beginning to wonder if it is an inconsistent behavior in Firefox, as I just loaded the page in Edge (the Chromium based one) and it came up just fine.

        Update:

        I cleared my Firefox cookies, and the page loaded. So there must have been some sort of cache failure. Still not seeing my scripting but now I can get back to testing.
        Last edited by cpp-dev; 06-16-20, 09:33 AM.

        Comment


          #5
          So here's the run down of what I've tired:

          1. Adding the script directly to the page header
          2. Adding the script directly to the page footer
          3. Putting the script into a JavaScript Resource - and attaching it to the page footer

          If it helps here's a pastebin (temporary) to the script -- http://paste.mozilla.org/n8GDbysh

          Comment

          Working...
          X