Discussions

Expand all | Collapse all

Javascript $.getScript inconsistencies

  • 1.  Javascript $.getScript inconsistencies

    Posted 03-27-2018 23:05
    I'm inserting javascript into a form using the img onload method  (   https://community.quickbase.com/quickbase/topics/how-do-i-setup-the-image-onload-technique-iol">https://community.quickbase.com/quickbase/topics/how-do-i-setup-the-image-onload-technique-iol">https://community.quickbase.com/quickbase/topics/how-do-i-setup-the-image-onload-technique-iol ) which is great work by Dan Diebolt, but the results aren't consistent in various browsers and difficult to debug from within developer tools. F5 (reload) doesn't trigger the script in firefox but does in chrome. 

    What's the reason that I can't insert a javascript file directly? It would be so much easier.


  • 2.  RE: Javascript $.getScript inconsistencies

    Top
    Contributor
    Posted 03-30-2018 13:45
    Placing your JavaScript into a code page should be the last thing you do. Normally you develop the script by working exclusively in the console as it is faster than updating the code page repeatedly. 

    There is nothing inconsistent about how $.getScript() works. The jQuery team has pounded out any problem with it years ago. You can use Shift F5 to force a cache reload. See:

    https://stackoverflow.com/questions/20569394/whats-the-difference-between-f5-refresh-and-shiftf5-in-...

    >What's the reason that I can't insert a javascript file directly? It would be so much easier.

    I agree. That questions would have to be answered by QuickBase directly. The IOL technique is a workaround for this limitation.


  • 3.  RE: Javascript $.getScript inconsistencies

    Posted 07-04-2018 10:31
    Hi Dan, thanks for all the great work in unlocking js for the community, if it wasn't for that I'd have to say "no can do" far too often, and now each time its maybe and then yes.

    How do you mean don't place the js in a code page, that's the ultimate location to place it in though isn't it? My workflow now is to download a page locally, insert the js inline and then work on it until its good and then place it in a code page. Still the ability to use the developer tools on live code would be helpful. Do you know why QB isn't opening this up more, I can understand that they don't want to support it which makes sense but  js vastly enhances QB's capabilities. Still, pretty happy with your solution!


  • 4.  RE: Javascript $.getScript inconsistencies

    Top
    Contributor
    Posted 07-05-2018 09:51
    >How do you mean don't place the js in a code page, that's the ultimate location to place it in though isn't it?

    Ultimately you would place your code into a code page. However, it is faster to just paste code into the console during development while refining and debugging your code. There are many benefits to working in the console because you can use all the development tools to debug, inspect,  override..

    >Do you know why QB isn't opening this up more, I can understand that they don't want to support it which makes sense but  js vastly enhances QB's capabilities.

    I can't speak for QB's motivations. With regard to extra support, using JavaScript with QuickBase should actually lessen the support because the JavaScript ecosystem provides an enormous tools, utilities and libraries that is supported by the browser manufactures, framework and library authors.

    I like your statement:
    JavaScript vastly enhances QB's capabilities