Forum Discussion

PeterRebholz's avatar
PeterRebholz
Qrew Member
4 years ago

[object Object] Error in Internet Explorer 11

Hello,

I have created a Formula Rich Text button that checks a box and reloads the page. The function works flawlessly in Chrome and Edge, but when using Internet Explorer 11 I get a blank page with "[object Object]". If I navigate away from this page I can see that the API call has gone through and the box is indeed checked. 

After digging around on the internet I thought it was the "location.reload();" javascript function. However, I dug into the Magic Buttons app, and the buttons that use "location.reload();" in there and they seem to work fine refreshing the page in IE 11.

Does anyone know of any other issues that could cause this, or alternate methods of accomplishing this task which would me more robust across different browsers?

Thank you!

var text target = "'blank'";
var text class = "'Vibrant Danger'";
var text style = "'width:100px; text-align: center;'";
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&key=" & [SCHEDULE NUMBER] & "&_fid_465=1"; 

If(
[HAS MDL]=false,
"<a " &
" class=" & $class &
" style=" & $style &
"href=" & "javascript:$.get('" & $URL & "',function(){location.reload();}); void(0);>Create MDL</a>"

)



------------------------------
Peter Rebholz
------------------------------

10 Replies

  • AustinK's avatar
    AustinK
    Qrew Commander
    Have you tried location.reload(true)? That is the only solution I am finding. I don't have internet explorer installed to test with though.

    • PeterRebholz's avatar
      PeterRebholz
      Qrew Member

      Hi Austin,

      Yes my apologies I forgot to include the other attempted syntaxes.

      I have tried:

      location.reload();
      location.reload(true);
      window.location.reload();
      window.location.reload(true);
      histroy.go(0);

      All of which give the [object Object] error


      I have also tried:
      window.location=window.location
      window.location.href=window.location.href

      Both of these execute the API call, but seem to freeze the page without refreshing it. 

      *Edit* had the order of "location" and "window" accidentally reversed 
      ------------------------------
      Peter Rebholz
      ------------------------------

      • BlakeHarrison's avatar
        BlakeHarrison
        Qrew Captain
        If the button is only doing these two functions - checking a field and then reloading the page, you can build the button without the JS. Here is how I would suggest:

        var text chk = "&_FID_34="; var text tk = "token"; "<a class='Vibrant Alert' & href=" & URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] & $chk & "1" & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) & ">Check and Refresh</a>"​
        Just update the FID and the Token in the Var's and you should be good to go.

        ------------------------------
        Blake Harrison
        bharrison@datablender.io
        DataBlender - Quick Base Solution Provider
        Atlanta GA
        404.800.1702 / http://datablender.io/
        ------------------------------