Here's what I want to do. I'm overriding a new/edit button for tasks. when a VF page loads, have it check a condition in my extension. If that condition is met, show a pop-up and re-deirect the user to the previous page. Otherwise, I want to call a method in my extension class which returns a PageReference, and send them there.
Is this possible? It seems like javascript remoting is what people use when they want to call a method from a controller, not an extension.
Here's where I am so far
<apex:page standardController="Task" extensions="TaskExtension" >
<apex:form>
<script>
var displayPopUp = {!method_from_extension};
if(displayPopUp == true ){
alert('Condition Not met. Please enter in info');
window.location ="/{!Id}"
}
else{
{!send_me_to_a_VF_page}
}
</script>
</apex:form>