Javascript if (j === null) do nothing
I am using CurvyCorners to make my corners curved in IE, the only thing is that when it reads the CSS it takes all the webkit properties and shows me a warning curvyCorners.alert("No object with ID " + arg + " exists yet.\nCall curvyCorners(settings, obj) when it is created.");
.
How can I just set an if statement to do nothing?
if (j === null)
do nothing(); //but in real script
Thanks:)
+2
a source to share
4 answers
I would recommend
if (j !== null) doSomething();
And Kooilnc is probably correct: curvyCorners is probably saying it can't find the element because the DOM hasn't finished loading yet. I would fight this problem with
window.onload = function()
{
var obj = document.getElementById("corneredObj");
if (obj !== null) {
curvyCorners(settings, obj);
}
}
+2
a source to share