Postponed
Project:
DrupalGap
Version:
8.x-1.x-dev
Component:
Module Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2018 at 05:20 UTC
Updated:
14 Dec 2020 at 21:54 UTC
Jump to comment: Most recent
Comments
Comment #2
tyler.frankenstein commentedComment #3
charlsweb9 commentedGot this error;
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at g (js_A803vhPaymb5XZ_xPLS45u3PdEyXjLaR4sq4YJszzKc.js:1406)
From this line of code:
var jDrupal={};jDrupal.init=function(){jDrupal.csrf_token=!1,jDrupal.sessid=null,jDrupal.modules={},jDrupal.connected=!1,jDrupal.settings={sitePath:null,basePath:"/"}},jDrupal.init(),jDrupal.config=function(a){var b="undefined"!=typeof arguments[1]?arguments[1]:null;return b?void(jDrupal.settings[a]=b):jDrupal.settings[a]},jDrupal.sitePath=function(){return jDrupal.settings.sitePath},jDrupal.basePath=function(){return jDrupal.settings.basePath},jDrupal.restPath=function(){return this.sitePath()+this.basePath()},jDrupal.path=function(){return this.restPath().substr(this.restPath().indexOf("://")+3).replace("localhost","")},jDrupal.isReady=function(){try{var a=!jDrupal.isEmpty(jDrupal.sitePath());return a||console.log("sitePath not set in jdrupal.settings.js"),a}catch(b){console.log("jDrupal.isReady - "+b)}},jDrupal.isEmpty=function(a){return null!==a&&"object"==typeof a?0===Object.keys(a).length:"undefined"==typeof a||null===a||""==a},jDrupal.functionExists=function(name){try{return"function"==eval("typeof "+name)}catch(error){alert("jDrupal.functionExists - "+error)}},jDrupal.inArray=function(a,b){try{if("undefined"==typeof b)return!1;if("string"==typeof a)return b.indexOf(a)>-1;for(var c=!1,d=0;d0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},jDrupal.time=function(){var a=new Date;return Math.floor(a/1e3)},jDrupal.lcfirst=function(a){a+="";var b=a.charAt(0).toLowerCase();return b+a.substr(1)},jDrupal.ucfirst=function(a){a+="";var b=a.charAt(0).toUpperCase();return b+a.substr(1)},jDrupal.Module=function(){this.name=null},jDrupal.moduleExists=function(a){try{return"undefined"!=typeof jDrupal.modules[a]}catch(b){console.log("jDrupal.moduleExists - "+b)}},jDrupal.moduleImplements=function(a){try{var b=[];if(a)for(var c in jDrupal.modules)jDrupal.modules.hasOwnProperty(c)&&jDrupal.functionExists(c+"_"+a)&&b.push(c);return 0!=b.length&&b}catch(d){console.log("jDrupal.moduleImplements - "+d)}},jDrupal.moduleInvoke=function(a,b){if(jDrupal.moduleLoad(a)){var c=a+"_"+b;if(jDrupal.functionExists(c)){var d=window[c],e=Array.prototype.slice.call(arguments);return e.splice(0,2),0==Object.getOwnPropertyNames(e).length?d():d.apply(null,e)}}},jDrupal.moduleInvokeAll=function(a){var b=[],c=Array.prototype.slice.call(arguments);c.splice(0,1);var d=[];for(var e in jDrupal.modules)jDrupal.modules.hasOwnProperty(e)&&jDrupal.functionExists(e+"_"+a)&&d.push(e);if(jDrupal.isEmpty(d))return Promise.resolve();for(var f=0;f
Here is the rest of the section of code:
// Set the Drupal site path.
var sitePath = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + drupalSettings.path.baseUrl;
jDrupal.config('sitePath', sitePath);
Comment #4
charlsweb9 commentedComment #5
berevan commented@charlsweb9 I got same error . can you please tell me how did you fix it
Comment #6
charlsweb9 commented