Here, this my html code
<html >
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<title>Hello World</title>
</head>
<body ng-app="socketApp" ng-controller="NewsController">
<script id="users" type="text/template">
</script>
<script>
onload = function(){
var users = document.getElementById('users').innerHTML;
// var names = ['loki', 'tobi', 'jane'];
var html = ejs.render("<ul><li><%= session.User.name %></li></ul>", { });
document.body.innerHTML = html;
}
</script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/sails.io.js"></script>
<script type="text/javascript">
io.sails.useCORSRouteToGetCookie = false;
io.sails.url = 'http://ift.tt/19KsEy9';
</script>
<!--script type="text/javascript" src="http://ift.tt/1pTC2UT"></script-->
<!--script type="text/javascript" src="js/socket.io.js"></script-->
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/ejs.js"></script>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
from the above code
var html = ejs.render("<ul><li><%= session.User.name %></li></ul>", { });
Here, i want to get sails server created session object in my cordova front end view. i tried many times , but i have't get session name. I'm very new to cordova . So , Please help me .
Aucun commentaire:
Enregistrer un commentaire