JQM Javascript is not been used

JQM Javascript is not been used

I have  search in the forum for the answer, found some stuff but its still not working.

In the first page(index), i have inserted the javascript into the data-role="page"

  1. ...
  2. <div data-role="page" id="swipepage">
    <script src="js/myjs.js"></script>
  3. ...

i have included alert to check if the javascript is been used.
scontent is the div id where this code will work

  1. alert("no ficheiro");
    $(document).on("pageinit", "#scontent", function(){   
        alert("scontent");

            //The code of the second page here.
            winWidth = $(window).width();   
            if(winWidth < $("#swipetable").width()){
                    MaxMenu = parseInt(winWidth/75)-2; //75px for each menu
                    $("#swipetable td:gt("+MaxMenu+")").hide(); //hide all menu that doest fit un the window
                   
                    $("#swipetable tr td:visible:last").after('<td style="text-align:center;width:75px; height:45px; background-color: #333333; color:#CCCCCC; font-family:Arial, Helvetica, sans-serif;border-right: 1px solid #AAAAAA;" id="btMore"><div><img src="images/bar_plus.png" style="width:45px;"></div><div>Mais </div></td>');
                    $("#swipetable").css("width","100%");
                   
                    $("#swipetable td:hidden").each(function(){
                        topcss = parseInt($('#moreBox').css("top"), 10);
                        newtop = topcss - 34;
                       
                        $("#moreBox").css("top",newtop);
                       
                        $("#moreBox").append('<li data-corners="false" data-shadow="false" data-iconshadow="false" data-wrapperels="div" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-d"><div class="ui-btn-inner ui-li"><div class=""><a class="ui-link-inherit" href="index.html">'+$(this).text()+'</a></div></div></li>');
                    });               
                   
                    $("#btMore").on('click', function(){$("#moreBox").toggle()});
                    //$("#swipetable td").g(parseInt(size-1)).hide();                   
            }
    });

    $(document).on("pageinit", function(){
        alert("scontent2");
    }




























is there anything wrong?