When you unset the item from array in foreach, all works as expected $array = [1,2,3,4]; foreach($array as $key => $value) { if($value === 2) { unset($array[$key]); continue; } echo “$value “; } Will return following: 1 3 4 When you want to do the same with ArrayObject, you would expect exactly the same behaviour. …
Blog Archive
Feb 07
Updated script for downloading file from javascript
I had to use the ajax to download a file internally on our NestForms project. I was searching for a solution and found one on Filamentgroup website. Unforutunatelly, there were some issues that it did not correctly encoded the request. So I had to update the script in order to make it working. See the …
Jun 05
OnBeforeUnload fun
Yesterday, we have encountered issues regarding window.onbeforeunload function. We have implemented checking of json transport issues, but this throws errors, when the page is beeing unloaded and we needed to hide these errors. So we implemented onBeforeUnload function, however we needed to preserve any previous onBeforeUnload functions. The issue here is that IE does not …
Jan 29
jQuery simple-color-picker
We use simpleColorPicker jQuery plugin. We had an issue that function .live() is depricated in jQuery 1.9. We solved it by replacing following line: Line 56: $(‘body’).live(‘click’, function() { Correction: $(document).on(‘click’, ‘body’, function() {
Jan 11
PHP – Post name max length
Hi everyone, I have found problem with PHP Version 5.3.2-1ubuntu4.18. When I tried to submit a form, values appeared in $HTTP_RAW_POST but there was nothing in $_POST. Problem was in legnth of name attribut. In other PHP versions is this length virtually unlimited, but in this version is length of each array key limited on …
Jun 11
Android – showing Google map in WebView
Hi everyone, I have resolved my little problem with showing Google map via WebView. When I tried to show map in WebView, I had seen only white box and nothing more, after short delay loading animation appeared and it was all. I was finding solution, but nowhere was described what I am doing wrong. Solution …
Dec 22
Android – Drawing route on MapView
Hi everyone, I had quite big problem with drawing route on MapView. Tutorials on the web which I found are quite confusing or with bugs. So I took several of them and did own program, which using some code from several tutorials . Here is source of my map activity: package tvarwebu.projects.map; import java.io.IOException; import …