Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModules"$.ServicesFramework is not a function" error only on mobile."$.ServicesFramework is not a function" error only on mobile.
Previous
 
Next
New Post
9/16/2016 3:03 PM
 
I ran into the same problem trying to build a custom html module that contained and http request. Worked fine when I was logged in as an admin but not as a regular user. The trick is to not depend on ServicesFramework at all. Just pretend it isn't there. All you need for a http request in dnn is the ModuleId and the TabId. In your ascx you can load these id's to the page like:

<%=ModuleContext.ModuleId %>
<%=ModuleContext.TabId%>

In my script I hard coded these values for testing as I'm using only html. My code:

angular.module('HtmlModule.factories', [])
.factory('Factory', ['$resource', function($resource) {
var self = this;

self.moduleId = 419;
self.tabId = 41;

self.headers = {
'Content-Type': 'application/json',
'ModuleId': self.moduleId,
'TabId': self.tabId
}


if ($.ServicesFramework) {
var sf = $.ServicesFramework(self.moduleId);
self.headers.RequestVerificationToken = sf.getAntiForgeryValue();
self.headers.TabId = sf.getTabId();
}

return $resource('/DesktopModules/PROJECT/Api/CONTROLLER/METHOD', {}, {
retrieve: {
method: 'GET',
headers: self.headers
}
});
}]);

That works!
 
New Post
9/1/2017 6:52 PM
 
Hi Guys, I had this same problem and wanted to share the solution. I noticed that the skin had something to do with it as when I used the Gravity skin the services worked but when I used my custom skin it would only work when the user was logged in. I copied the skin over and made one change at a time to see where it failed - it wound up being a control. Strangely enough when I removed the "search" control from the skin the ServicesFramwork.js wouldn't load unless you were authenticated. I Included it in my skin and hid it with a bit of jquery and everything works perfectly now. I hope this helps someone.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModules"$.ServicesFramework is not a function" error only on mobile."$.ServicesFramework is not a function" error only on mobile.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out