top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Webstorage APIs or JS objects in browsers?

+1 vote
63 views

Which option is better for local storage at browsers? Why to use webstorage APIs when same can be achieved through Javascript objects?

posted Jul 12, 2013 by Suyash Tripathi

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

There are advantages with Web Storage APIs. They offers more storage capacity (usually 5MB) but cookies allow only about 4KB. The data stored in the local storage area does not expire and spans accross different tabs and/or windows. The Web Storage specification is better designed and provide more secure way of storing data on the client.

answer Jul 12, 2013 by Sudheendra
Similar Questions
+3 votes

I am trying to debug a javascript file, which is used in a .jsp file. When I debug the using F12 in IE10 I did not find that particular file in the debugger tool.

Can anybody please tell, why that particular file is not showing even it is present in project folder location?

+1 vote

History / Context: Display the html page from node.js

Problem Statement: The database is connected, but when i am running it in local host it is showing 'Cannot GET'.

Expected Result: It should load the html page from node.js

Present Output: Database is connected but cant load the page of html

Attach Code:

filter.js

var express = require('express'),
    filter = express(),
    server = require('http').createServer(filter),
    io = require('socket.io').listen(server),
    mongoose = require('mongoose');

server.listen(7550, '127.0.0.1');
console.log('Server running at http://127.0.0.1:7550/');

mongoose.connect('mongodb://localhost/filter_CheckBoxSchema', function (err) {
    if (err) {
        console.log('What happened!!!');
    } else {
        console.log('Connected to mongodb!');
    }
});

var filter_CheckBoxSchema = mongoose.Schema({
    category: { name: String, type: Boolean, default: false },
    created: { type: Date, default: Date.now }
});

var Filter = mongoose.model('Filter', filter_CheckBoxSchema);
filter.get('example.html', function (req, res) {    
    new Filter({
        name: req.body.name,
        type: req.body.gender,

    }).save(function (err, doc) {
        if (err) {
            throw err;
        }
        else
            res.send('Successfully inserted!!!');
    });
});

example.html

<html>
    <head>
        <title>
            Please enter your details
        </title>
    </head>
    <body>
        <h3>Please enter your details</h3>
        <p>Please register below!!!</p>
        <form action="filter.js" method="POST">
            Name: <input type="text" name="Name" />
            <br /><p></p>
            Gender:
            <br />
            <input type="radio" name="gender" /> Male
            <br />
            <input type="radio" name="gender" /> Female
            <p></p>
            Interest: (Check all that apply)
            <p>
            </p>
            <input type="checkbox" name="breakfast" /> Breakfast
            <br />
            <input type="checkbox" name="Lunch" /> Lunch
            <br />
            <input type="checkbox" name="Evening Snacks" /> Evening Snacks
            <br />
            <input type="checkbox" name="Dinner" /> Dinner
            <br />
            <p></p>
            <input type="submit" name="submit" value="Register!!!" />
        </form>
    </body>
</html>
+3 votes

which software (html/css/js..etc etc) is required to create website like www.livebooks.com or Photoshelter.com (DIY: do it yourself).
for Frontend and backend both??


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...