I'm new in Javascript and this is my code
<!DOCTYPE html>
<html>
<body>
<a href="http://www.example.com" id="test" onclick="example(this); return false"><img src="http://www.example.com/1/img" border="0" /></a>
<script>
function () {
document.getElementById('test').click();
};
function();
</script>
</body>
</html>
I was trying to open that link when the web page is loaded but I make some errors. Any help?