Unable to get property 'indexOf' of undefined or null reference
Solution:
Use if condition.
var myvalu="Hello&Welcome";
var k;
if((myvalu!=null)&&(myvalu!=undefined))
{
if(myvalu.indexOf("&") != -1)
{
k=myvalu.substring(myvalu.lastIndexOf('&')+1);
}
}
Solution:
Use if condition.
var myvalu="Hello&Welcome";
var k;
if((myvalu!=null)&&(myvalu!=undefined))
{
if(myvalu.indexOf("&") != -1)
{
k=myvalu.substring(myvalu.lastIndexOf('&')+1);
}
}