I have found an interesting bug about this. This code works now in parts of my task pane. Here is the example Code.
function refresh()
{
window.location.reload( false );
}
//When I Run this line with the Refresh() function it gives a permission denied error..
<ul class=plain>
<li><a class=p href="http://www.infopathdev.com/forums/AddPost.aspx?PostID=21474#" OnClick="refresh();if (View.Name != 'Home') View.SwitchView('Home');return false;">Home</a>
</li>
</ul>
//When I Run this line it works
<li><a class=p href="http://www.infopathdev.com/forums/AddPost.aspx?PostID=21474#" OnClick="refresh();doSave();">Close and save</a>
</li>
The error started when I switched to Full Trust....This error has just confused me to no end. Any ideas??