a problem about import 3rd js

a problem about import 3rd js

hi,all,
My project has two pages:login.jsp and mainpage.jsp,

I want to import specific js like this:

<script src="js/jquery.slides.min.js"></script>

which could help to show slide images into my  mainpage.

And I also read about this faq:

now I put the js inside "page",and call its method: slidesjs .

<div data-role="page" id="pageone" data-theme="b">
<script src="js/jquery.slides.min.js"></script>
<script>
/* $(document).on("pageinit","#pageone",function(){
alert(1);
 $('#slides').slidesjs({
       width: 940,
       height: 528,
       play: {
         active: true,
         auto: true,
         interval: 4000,
         swap: true
       }
     });   
 alert(2);
}); */
 $(function(){
 
  $('#slides').slidesjs({
       width: 940,
       height: 528,
       play: {
         active: true,
         auto: true,
         interval: 4000,
         swap: true
       }
     });   
}); 
</script>
....
</div>

It is OK when you directly load mainpage like picture one,but if you redirect mainpage  via login,the methods will be not called like pictrue two.

Buy the way I use springmvc framework.

pic one
pic two