Scooby doo not working on Firefox, IE. My code basically grabs old and new values, check for changed, then adds the changed values to a new db. http://pastie.org/10884465

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Photo of John

John

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
You are writing your code as if it were synchronous although all the AJAX requests are asynchronous. There is no guarantee that this code will assign to the global variable schema before the next block of code starts to run:

 $.post(thisDB, {
   act: "API_GetSchema"
 }).then(function(res) {
   schema = res;
   return;
 });

You have to place your functional code inside the then block or it will run before the response from the AJAX code is returned.

Photo of John

John

  • 0 Points
I've removed that $.post, but it still runs the code before hitting save on Firefox (document.location.href = gReqDBID + "?a=td";), any ideas?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
I didn't really read the whole script but just complained about the first thing that looked wrong.  I will put it on my list to look at when I have time.
Photo of John

John

  • 0 Points
Thanks for all of your awesomeness! I am wondering if maybe there should be a timeout on Firefox.. b/c it is running that iframe code block on page load and on save.
Photo of John

John

  • 0 Points
Also, I have a table using the image load technique, but in the report the "-" field says module.js in all records?? But on my other table (set up exactly same) the field is empty like it should be? Any idea why it works on one table but not on the other?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
The field [-] has ro have the checkbox set to allow some HTML.
Photo of John

John

  • 0 Points
That's the strange thing going on, that checkbox is set and everything else is set up correctly, and my script works. My only problem is that it says "module.js" on all records. (on the td page).
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
What is the formula for the [-] field?
Photo of John

John

  • 0 Points
[iol] & "module.js" & [\iol]
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
wrong slash - should be [/iol]
Photo of John

John

  • 0 Points
sorry I was just about to edit that comment, it is a "/" and not "\"
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
This does not make any sense. To debug (1) hold your  mouse over "module", (2) right  mouse click and (3) select the last entry Inspect. Paste the fragment of code the inspector displays.
Photo of John

John

  • 0 Points
<td>module.js</td> == $0 is what highlights when I click inspect over "module.js" in the table.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
What are the values for the user defined variables [iol] and [/iol]?

Is this problem unique to Firefox?
Photo of John

John

  • 0 Points
It happens on all browsers (chrome, safari, firefox, and ie).
Photo of John

John

  • 0 Points
I have the same setup in another test app/table and it does not display the "module.js". Just weird.
Photo of John

John

  • 0 Points
Ok, so I may have figured out what's going on. The "existing records" in the table have the "module.js" in the [-] field, and the script does not work on their edit page. But if I add a new record, it works like it should with no "module.js" in the [-] field and the edit page works. So, any ideas how to fix that? Besides removing all 314 records and inserting again. :)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
>Scooby doo not working on Firefox, IE. 

I found the problem and have a fix. See this post:

https://community.quickbase.com/quickbase/topics/what-is-the-save-and-scooby-doo-technique