I have a link on an object that contains code similar to the following.
var VFBase = "/apex/MyVFPageName_";
var DBFld = "{!MyObject__c.MyField__c}";
var Suff = "?id={!MyObject__c.Id}";
var VFFull = VFBase.concat(DBFld);
var VFFull = VFFull.concat(Suff);
window.open(VFFull);
So it creates a VF Page name based on a field value on my object that will be something like...
/apex/MyVFPageName_A?id={!MyObject__c.Id}
or
/apex/MyVFPageName_B?id={!MyObject__c.Id}
What I want to be able to do is before the window.open is test for the existence of the VF Page.
So if /apex/MyVFPageName_A or /apex/MyVFPageName_B does not exist then I want to instead open a page called /apex/MyVFPageName (which I know will for sure exist)
What I need to know is how I can check for the existence of a given VF page before I attempt to open it.
Any assistance would be greatly appreciated.