How to check if duplicate key exists in local -storage in ionic
How to check if duplicate key exists in local -storage in ionic
Unexpected token < in JSON at position 80 at JSON.parse ()
Posting a screenshot of your desktop is one of the impolitest things you can do.
Please post the error message as text, include your ionic info
output, what code you are running and what JSON the server is returning that causes this error.
Etiqueta
Etiqueta
Runtime error when executing ionic-starter-aws
There are issues about that on the Github repo. One of them: https://github.com/ionic-team/ionic2-starter-aws/issues/20
Also you can use ionic info
on the command line to get a good overview of the environment.
Runtime error when executing ionic-starter-aws
Thanks a lot! I did not see the issues...
Help with AWS IoT Sample
Looking at the PDF I think the command in there is outdated. This is creating and assuming a Ionic v1 project, the current CLI by default creates a v2+ project. You will need to add --type=ionic1
to the start command to get the right type of project for this to work.
Unexpected token < in JSON at position 80 at JSON.parse ()
lo que muestra en la consola
Notice: Undefined index: Correo in C:\xampp\htdocs\final_slim\api\app\route\auth_route.php on line 13
Notice: Undefined index: Password in C:\xampp\htdocs\final_slim\api\app\route\auth_route.php on line 13
y la linea 13 lo que tengo en el json_encode
$app->group('/auth/', function () {
$this->post('autenticar', function ($req, $res, $args) {
$parametros = $req->getParsedBody();
return $res->withHeader('Content-type', 'application/json')
->write(
json_encode($this->model->auth->autenticar($parametros['Correo'], $parametros['Password']))
);
});
});
Ionic cli 3.4 issue
Also for creating a new project?
What happens if you choose n
?
Unexpected token < in JSON at position 80 at JSON.parse ()
Your PHP is broken. $parametros['Correo'], $parametros['Password'] both do not exist, so the code doesn't work.
Ionic cli 3.4 issue
no i updated my existing project project from 2.2.2 to latest.
if i choose n it's noting happen any thing
Ionic cli 3.4 issue
Please create a new project with ionic start
to see what happens.
Ionic cli 3.4 issue
Also run ionic info --verbose
in your project, then choose "y" when prompted.
Ionic image dont see
<ion-col col-4>
<img id="cls1" [src]="src1">
</ion-col>
Try that.
I can't parse json ajax data
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
Unexpected token < in JSON at position 80 at JSON.parse ()
en el formulario si le quito la etiqueta funciona todo bien , este código lo e usado en otros proyectos y todo bien, pero cuando lo pase ionic v 1 me encontrado con este error .
este es el codigo de mi service que tiene toda la lógica para consumir mi REST API
gracias por la ayuda
angular.module('app.services', [])
.factory('auth', ['$state', function ($state) {
var auth = {
setToken: function (token) {
window.localStorage[API.token_name] = token;
},
getToken: function () {
return window.localStorage[API.token_name];
},
getUserData: function () {
console.log(auth);
try{
var token = window.localStorage[API.token_name];
if (token === '') return;
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
console.log()
return JSON.parse(window.atob(base64)).data;
} catch(err) {
$state.go('signup');
}
},
logout: function () {
window.localStorage[API.token_name] = '';
$state.go('signup');
},
hasToken: function () {
return (window.localStorage[API.token_name] !== '');
},
redirectIfNotExists: function () {
if (!auth.hasToken()) {
$state.go('signup');
}
}
};
return auth;
}])
.service('loader', function () {
this.show = function (show) {
document.querySelector("#loader").style.display = show ? 'block' : 'none';
};
})
.service('restApi', ['$http', 'loader', 'auth', function ($http, loader, auth) {
this.call = function (config) {
var headers = {};
headers[API.token_name] = auth.getToken();
loader.show(true);
var http_config = {
method: config.method,
url: API.base_url + config.url,
data: typeof (config.data) === 'undefined' ? null : config.data,
headers: headers
};
$http(http_config).then(function successCallback(response) {
loader.show(false);
config.response(response.data);
}, function errorCallback(response) {
loader.show(false);
switch (response.status) {
case 401: // No autorizado
auth.logout();
break;
case 422: // Validación
config.validationError(response.data);
break;
default:
config.error(response);
console.log(response.statusText);
break;
}
});
};
}])
I can't parse json ajax data
Can you open this URL - https://2fe.ru/api/formmaker/submission ?
webpackJsonp not found when running ionic-starter-aws
This is great! Thanks!
Unexpected token < in JSON at position 80 at JSON.parse ()
Please edit your post, it is not very readable at the moment.
Use the </>
button above the input field to format your code, command line output or error message (select the text first, then click the button or wrap it in ```
manually). Check the preview if it looks better. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.