We inconsistently see this error in our logs: Cannot read property 'substring' of undefined
It occurs on this line of code: var sPageURL = window.location.search.substring(1)
Unfortunately, the error is not consistently reproduced, but the flow is:
-
Open new window via JavaScript.
-
In new window, invoke this line of code.
Based on Googling, internal testing, and answers like this, it seems like window.location.search
should at worse but the empty string, but never undefined. If window
or location
were undefined, then it would be expected for the error to appear differently.
Under what conditions could window.location.search
be undefined?
Aucun commentaire:
Enregistrer un commentaire