0

Chrome拡張機能が機能していません。これが私のコードです...

//manifest.json

{
    "manifest_version": 2,
    "name": "auto login",
    "description": "With this extension you can auto login.",
    "version": "1.0",
    "permissions": [ "http://*/*" ],

    "browser_action": {
        "default_icon": "icon.png",
        "default_popup": "popup.html"
    }
}

// popup.html

<!DOCTYPE HTML>
<html>
<head>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script>
        $(document).ready(function(){
            $('#submit').click(function(){
                var data = document.getElementById("username").value;
                localStorage["username"] = data;
            });
        });
</script>
    <title>Hello World!</title>
</head>
    <body>
        <form name="login">
            <fieldset>
                <legend>Log In</legend>
                <table>
                    <tr>
                        <td><label for="username">Username</label></td>
                        <td><input type="text" name="username" id="username"/></td>
                    </tr>
                    <tr>
                        <td><label for="password">Password</label></td>
                        <td><input type="password" name="password" id="password"/></td>
                    </tr>
                    <tr>
                        <td><input type="submit" value="verzenden" name="submit" id="submit"/></td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </body>
</html>

このコードが機能しないのはなぜですか? このスクリプトを使用して、ユーザー名とパスワードの値を保存できません。誰か助けてくれませんか?

4

2 に答える 2