• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Javascript isnt working

Matthew Hawley

Well-known member
Can anyone tell me why this javascript isn't working?

Nvm I didnt wrap it in $(function() { });

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
    $("#btn_get_repos").click(function() {
        type: "GET",
        url: "https://api.github.com/users/google/repos",
        dataType: "json",
        success: function(result) {
            for( i in result ) {
                    "<li><a href='" + result[i].html_url + "' target='_blank'>" +
                    result[i].name + "</a></li>"
                console.log("i: " + i);
            $("#repo_count").append("Total Repos: " + result.length);

<li id="ourTab" class="profileContent">
    <div id="repos">
        <ul id="repo_list"></ul>
    <div id="repo_content"></div>
    <button id="btn_get_repos">Get Repos</button><span id="repo_count"></span>
Last edited: