Using the Xcode simulator to test a website we are developing, we ran into the following issue:
HTML
<input type="hidden" id="saveId" name="saveId" val="<?=$saveId?>" />
($saveId is passed by the PHP and can be a value or empty)
1 var saveId = $('#saveId').val();
2 if (saveId) {
3 window.location = relativePath + 'autoSave/continueListing?saveId=' + saveId;
4 }
PROBLEM
On the Xcode simulator (running iOS 9.1), if $saveId="", the window gets refreshed with a new URL of
autoSave/continueListing?saveId=null
On other javascript implementations (eg Chrome, Firefox and Edge), the test at line 2 is ignored in this instance.
Using the debugger, we can see that the value at line 2 in the Xcode simulator is """" so an empty string, rather than null.
Any ideas why this is happening?
Marco