I have written a javascript function whose purpose is to open a case in a primary tab.The idea is to access this function in VF Page through but i'm unable to do it.When i'm opening the page microsoft script editor it's giving me compilation error in line no. 1.Can anyone point out to me what's wrong in this js code? (BTW this one is working fine when i'm including the code inside the VF Page)
<script type="text/javascript">
function openCase(caseId)
{
if(sforce.console.isInConsole())
{
sforce.console.openPrimaryTab
(null,'/'+caseId,true);
}
else
{
window.open('/'+caseId);
}
return false;
}
</script>
<script>
tags in the js file stored in static resource? If yes then remove it and then try