If you can use jquery then you can put the alert inside the $(document).ready()
function. it would look something like this:
<script>
$(document).ready(function(){
alert('<%: TempData["Resultat"]%>');
});
</script>
To include jQuery, include the following in the <head>
tag of your code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
Here's a quick example in jsFiddle: http://jsfiddle.net/ChaseWest/3AaAx/