iOS - Safari crashed after large object creation

Hello! I run into a problem when I want to save a variable with a rather large object.

I test it directly in the safari console by connecting the iphone to the macbook: var test = {{largeObject}}


The object size (stored in a file) is around 280kb.


After the creation attemp, the console close itself and the page reloads with the message "This webpage was reloaded because a problem occurred".

Why is this happening? Is there a limit for object variables in iOS? What would be the solution to work with a large object in my website?


I'd really appreciate your help.


Best regards,


Martín

Accepted Reply

Well, i figured it out.


The problem wasnt the object but a property that was an array of near 19k objects.


{
     "prop1": "value1",
     "prop2": "value2",
     "prop3": [
          {"a":1},
          {"b":1},
          {"c":3},
          //... 19000 times
     ]
}


I replace that array with an object and now it look like this:


{
     "prop1": "value1",
     "prop2": "value2",
     "prop3": {
          "a":1,
          "b":1,
          "c":3,
          //... 19000 times
     }
}


and it also works fine with iphone iOSv11


The problem i reported only occured with iphone. It works perfectly well in macbook and pc/android. Both objects.

Replies

Well, i figured it out.


The problem wasnt the object but a property that was an array of near 19k objects.


{
     "prop1": "value1",
     "prop2": "value2",
     "prop3": [
          {"a":1},
          {"b":1},
          {"c":3},
          //... 19000 times
     ]
}


I replace that array with an object and now it look like this:


{
     "prop1": "value1",
     "prop2": "value2",
     "prop3": {
          "a":1,
          "b":1,
          "c":3,
          //... 19000 times
     }
}


and it also works fine with iphone iOSv11


The problem i reported only occured with iphone. It works perfectly well in macbook and pc/android. Both objects.