Re: TypeError: null is not an object (evaluating 'f.focus')

Solved! Go to solution
udhaya2486
Newbie

TypeError: null is not an object (evaluating 'f.focus')

Hi,

I am integrated VISA checkout flow and used to sdk file. visa checkout login is working for android chrome brower but in safari browser i am getting some error and login screen is not coming in iphone(TypeError: null is not an object (evaluating 'f.focus')). Can you please help on this. thanks

2 REPLIES 2
Sanobar
Frequent Helper

Re: TypeError: null is not an object (evaluating 'f.focus')

Hello,

 

Sorry for the in convenience, this is a known issue. please share screen shots (if possible) to help de-bugg by visa checkout expert team. send the details on our support email developer@visa.com

 

Thanks

Sanobar

jefryarch
Newbie

Re: TypeError: null is not an object (evaluating 'f.focus')

This error occurs when you read a property or call a method on a null object . That's because the DOM API returns null for object references that are blank. An object is expected somewhere and wasn't provided. So, you will get null is not an object error if the DOM elements have not been created before loading the script. In JavaScript , null is not an object; and won't work. You must provide a proper object in the given situation.

 

We can resolve this type of issues by adding an event listener that will notify us when the page is ready. Once the addEventListener is fired, the init() method can make use of the DOM elements.

 

document.addEventListener('readystatechange', function() {
if (document.readyState === "complete") {
init();
}