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
6/24/2015 2:34 PM
 

Still banging my head against this one....

After much testing here's where I stand.

I did get the servicesframework loaded by implicitly making the call from the code behind view.cs file. Although I'm not thinking this had anything to do with it now.

If I log in as admin everything works as it should both when using a mobile client as well as using a desktop web client. However, if I log in as a normal user everything works fine only on the desktop web client. It's as if the servicesframework does not function at all on the mobile client if a normal user is logged in. It doesn't appear to be skin related as I have tried several different skins  on the mobile page with the same results.

For testing I put the following snippet at the top of my javascript block of code:

$(document).ready(function() {
var servicesFramework = $.ServicesFramework(1244);
var token = servicesFramework.getAntiForgeryValue();
oken);
}); 

It correctly shows the token when logged on as admin both for web and mobile, however it only shows the token on the web client for a regular user. When a regular user accesses it using a mobile client the token comes back as "undefined". 

 Any hints as to where to look next would be greatly appreciated. I just can't get my head around why a regular user accessing the same module placed on two different pages would wind up with different results. Oh, and the permissions both on page and module are identical on both pages.

Help please! I'm out of ideas.

 
New Post
6/24/2015 4:36 PM
 
We know that the services framework is not being loaded in the mobile env.

You mentioned that the mobile skin has 'things stripped out'. I would guess that one of those things loads the services framework and therefore keeps your code happy. If it is dependent on the login account then the thing that loads the framework must do it conditionally.

I've never used this stuff so I cannot offer specific advice. There is a script skin object that is supposed to take care of all the details of loading things just once.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/4/2016 11:10 AM
 
After some head scratching I thought would add to this thread. I have been bumping into this issue while developing a module that will live on a page that does not use the search skin object. If the search skin object is on the page or a user is logged into the site the client side ServicesFramework is available. Otherwise the ServicesFramework is not available.

What I found is that as long as I insert this line of code in the Page_Load event of the module's .ascx file the ServicesFramework JS will be available regardless of the skin or skin objects used. I believe any module using the client side services framework js should implement it as you cannot be sure that a skin will be using any particular skin object. I hijacked it from the Search Skin Object code here: https://github.com/dnnsoftware/Dnn.Pl...

DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();

If you have this error on an existing page, and you are not developing your own module, I would suggest trying to add the search skin object onto the skins page even if you are not using it. It will force the loading of the client side Services Framework js albeit with some bloat.


 
New Post
1/20/2016 5:49 PM
 
I'm having a similar issue when I switch the Client Resource Management's "Enable Composite Files" to true. Still trying to figure that out... guessing it's an order of files issue.

David O'Leary
Efficion Consulting
 
New Post
1/21/2016 1:55 AM
 
Instead of $.ServicesFramework() try change it to jQuery.ServiceFramework()
This solve my issue.
 
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