Jquery error on newly created backend pages
I've created a new backend page, under the "User Management"
folder. However, as soon as the page is loaded, even before
I insert any widgets there, I get a javascript error:
"Uncaught TypeError: jQuery is not a function"
In the following code:
<script type="text/javascript">
if (jQuery(".sfSiteSelectorMenuWrp").length > 0)
jQuery("body").addClass("sfHasMultiSite");
</script>
which is sitefinity native code.
The reproduction steps are:
Administration->BackEnd Pages->User Management - Create Child Page
Has anyone else had this problem before?
Best regards,
Diogo Bastos
Hello Diogo,
On which version you are observing that behaviour? Are you using the default template, custom one or start from scratch?
In case of custom template do you have any scripts loaded?
Testing it on 8.2 works fine. The page is created without any errors using the default template or start from scratch (screenshot).
Regards,
Svetoslav Manchev
Telerik
We have the exact same problem after an upgrade to 8.2. Did you figure out what caused it?
Hello Nelson,
What is the jQuery version used in your project? Sitefinity 8.2 uses jquery 1.11.2.
You can check also under: Administration > Settings > Advanced > Pages > Script Manager > Script References > JQuery
In case there some different version is loaded.
Regards,
Svetoslav Manchev
Telerik
Hello, sadly I did not figure out the problem. After making sure that the Jquery versions matched and that the problem was not in the configurations, I resigned myself to creating a new page template and loading the scripts with script widgets.
Hope this helps.
Regards,
Diogo
Hello, we have this exact same problem when creating a new backend page. After some trying, the solution that we use is importing jQuery manually from custom ascx file used in that page by using Sitefinity Resource link, like so:
<sitefinity:ResourceLinks ID="resourcesLinks" runat="server">
<sitefinity:ResourceFile JavaScriptLibrary="JQuery" />
</sitefinity:ResourceLinks>
Hope this helps to whoever encounter this problems in the future