Implicit references etc.
Posted: Sat Nov 11, 2023 12:28 pm
Hi Clifton.
I'm still bashing away at what I hope will be the final version of my project. I am trying to tidy up the code and looking for any remaining bugs. There can't be many left... but I've said that many times before. Today I have found solutions to a couple of problems. Perhaps you could explain why they occurred, if you have time, please?
1) In my code I use references to files and folders such as this: filesHome = "../../" + this.VArray [2] + "/" + this.VArray [5] + "/teachers/" + this.VArray [7] + "/" + this.VArray [6] + "/" + this.VArray [3] + "/";
Alternatively I sometimes use: filesHome = "/programs/" + this.VArray [2] + "/" + this.VArray [5] + "/teachers/" + this.VArray [7] + "/" + this.VArray [6] + "/" + this.VArray [3] + "/";
I decided to 'tidy things up' by using only one system. I replaced all occurrences of "/programs/" with "../../" Days later I discovered that a certain function would no longer work in Firefox and Edge but there was no problem in Chrome. The function was for downloading. I use pgExecuteRemote to execute a function in an embedded html file like this:
<a style="visibility: hidden" id="dl" href="" download></a>
function downloadFile(fileName)
{
document.getElementById("dl").href = fileName;
document.getElementById("dl").click();
};
After days of searching, I discovered that if I use "../../" etc in the fileName variable, it doesn't work (in Firefox and Edge) but if I replace this with "/programs/", it does. Should I now replace all occurrences of "../../" with "/programs/" to be on the safe side? What do you think?
2) The other problem is simpler. I was trying to create a private cookie with createCookie(). If I name the cookie "docs" it fails but if I name it "mdc_docs", all goes well. Is "docs" a reserved name or is it too short?
3) It seems that Microsoft may have addressed the problem of wrong analysis of files in Windows 11. I mean innocent files being flagged up as viruses. When I installed the latest version of Powerpac on Windows 11, I had the option to ignore the warning. That doesn't happen on Windows 10 and I now have to stop Windows Defender before I can install.
John
I'm still bashing away at what I hope will be the final version of my project. I am trying to tidy up the code and looking for any remaining bugs. There can't be many left... but I've said that many times before. Today I have found solutions to a couple of problems. Perhaps you could explain why they occurred, if you have time, please?
1) In my code I use references to files and folders such as this: filesHome = "../../" + this.VArray [2] + "/" + this.VArray [5] + "/teachers/" + this.VArray [7] + "/" + this.VArray [6] + "/" + this.VArray [3] + "/";
Alternatively I sometimes use: filesHome = "/programs/" + this.VArray [2] + "/" + this.VArray [5] + "/teachers/" + this.VArray [7] + "/" + this.VArray [6] + "/" + this.VArray [3] + "/";
I decided to 'tidy things up' by using only one system. I replaced all occurrences of "/programs/" with "../../" Days later I discovered that a certain function would no longer work in Firefox and Edge but there was no problem in Chrome. The function was for downloading. I use pgExecuteRemote to execute a function in an embedded html file like this:
<a style="visibility: hidden" id="dl" href="" download></a>
function downloadFile(fileName)
{
document.getElementById("dl").href = fileName;
document.getElementById("dl").click();
};
After days of searching, I discovered that if I use "../../" etc in the fileName variable, it doesn't work (in Firefox and Edge) but if I replace this with "/programs/", it does. Should I now replace all occurrences of "../../" with "/programs/" to be on the safe side? What do you think?
2) The other problem is simpler. I was trying to create a private cookie with createCookie(). If I name the cookie "docs" it fails but if I name it "mdc_docs", all goes well. Is "docs" a reserved name or is it too short?
3) It seems that Microsoft may have addressed the problem of wrong analysis of files in Windows 11. I mean innocent files being flagged up as viruses. When I installed the latest version of Powerpac on Windows 11, I had the option to ignore the warning. That doesn't happen on Windows 10 and I now have to stop Windows Defender before I can install.
John