In my usercontroll, I have put the tag
Company name
Not what I wanted, but it works :)
The EPi js object is used to encapsulate a lot of EPiServer related javascript functions (to easier avoid conflicts with your own and others javascript) and is instantiated in EPiServerScriptManager.js.
The script function EPi.SetupPropertyObjects registered on the page (in this case by right click menu) won't work without the EPiServerScriptManager.js first instantiating the EPi object. The SetupPropertyObjects function is called from within the EPiServerScriptManager.js on window load so they are intimately related.
However, the right click menu should also register the EPiServerScriptManager.js. We have had issues in earlier versions of CMS 5 where the registering of required javascript files did not occur in some scenarios and to overcome this you had to include the EPiServerScriptManager.js (and/or other js files) yourself, like Linus suggests above. But I don't recall right click menu to be one of those issues.
Hopefully I have managed to explain a little what is going on and how things relate to each other.
@Ted For above reasons there is no easy answer to why you unwillingly have the EPiServerScriptManager.js included to your pages and I really don't know how to help you. Do you get the EPi.SetupPropertyObjects or EPi.SetupEvents function(s) registered in the bottom of the page? If you do I would love to see what they say...
/Henrik
Co-inventor of EPiServerScriptManager.js...
Hi Henrik,
We are getting this EPiServer-script on all of our pages for no obvious reason. The user is not even logged in and still it shows up.
<script type="text/javascript">
//<![CDATA[
EPi.SetupPropertyObjects = function()
{
EPi.RegisterPropertyObject(window, "EPiObject", {EPiOnPageEditControl:"OnPageEditControl"});
}
//]]>
</script>
It seems to cause the following javascript error for people on the internet surfing to the site: "Fel: 'EPi' är odefinierad". A strange thing is that the error-message doesn't show up for people at work.
Can you, from this information, tell us what could be wrong?
//Stefan
Hi Stefan (and everybody else)!
I want to investigate it a little further (when at work) but it's definetely related to On Page Edit, aka OPE, former known as DOPE , but as you state there is no reason why it tries to register this when users not logged in are accessing the site. Which version of CMS are you using?
A quick fix to avoid the javascript error is to include the /Util/Javascript/EPiServerScriptManager.js to your pages but that's not really the solution since you don't have any use for it (well you possibly could but let's not get into that).
But I really have to look up what's going on with OnPageEditControl before I can come with a possible solution/answer.
/Regards
Henrik
Hi again,
I have done some investigations and my conclusion is that this behavior is considered to be a bug and I have reported it.
There is, to my knowledge, no easy way to avoid the script from being registered unless you stop using the context menu (right click menu) on your template pages (for editors/admins). I however haven't tested this but since the bug is related to the context menu I think this will prevent the script from being added.
If you still want the context menu to be available for logged in users, there are two ways to avoid the script error with "EPi is not defined". One way is to make sure the EPiServerScriptManager.js is registered on the page as I suggested in previous post. The other way is to include below js code in some other js file you make use of in your pages or by adding the script directly to your pages but before the EPi.SetupPropertyObjects code.
if (typeof(EPi) == "undefined") {
var EPi = {};
}
That is about all I can suggest at the moment. I really can't say why this behavior haven't been discovered earlier or when a fix will be available.
/Regards
Henrik
I am facing the same problem.I am using Episerver 5 R2 .but in my case
all the javascript is been referred in html source rendered.
<script src="/MyEPiServer/util/javascript/episerverscriptmanager.js" type="text/javascript"></script>
<script src="/MyEPiServer/util/javascript/onpageedit.js" type="text/javascript"></script>
<script src="/MyEPiServer/util/javascript/contextmenu.js" type="text/javascript"></script>
BUt still I am getting error "EPi is not defined" .
Note: In my case no error working with .Visual Studio.error comes only when deployed in IIS.
Dear Steven Stieng ,
can you pls explain " After some seriouse e-mailing with EPiServer, we found the solution. I had put all content of the tag in a user controll. So in the masterpage it looked like this:
In my usercontroll, I have put the tag This unfortunately causes EPiServer to output and empty Not what I wanted, but it works "
Hi,
Any news on this? I have done a fresh install of relate+ on my local box and I am getting this error when first viewing the site.
Thanks a lot
I have discovered that this is due to an url with small/capital letters. (I know you don't beleive me ;-)
In my installation the Util url is /Util and the call is /util and it's causing this error. When I correct it in the web.config with just small letters the epi-object is defined.
Check your spelling in web.config regarding the util-path!
I also had a fresh install of Relate+ on my local box and was having the same error.
The fix above solved the problem. Thanks.
The javascript error message is: Line 390 Char 1 Error: 'EPi' is undefined Code: 0 URL: http://localhost/en/.... -> {rest of the url} Anyone else got this problem?