由于jquery插件,图片上传不再上传图片

时间:2016-05-04 10:58:18

标签: php jquery jquery-mobile

我正在使用Jquery mobile,我有一个包含文件上传的表单,用于上传要保存在文件夹和数据库中的个人资料图片。当我将jquery 1.8.2 min.js插入时,它运行良好但它搞砸了我的listview搜索,但当我将jquery 1.8.2更改为1.5.2时修复了listview搜索,但现在不允许我上传图片,当我点击它不打开目录。我删除的那一刻jquery 1.8.2所以我无法上传图片。可以有人建议我可以使用什么来修复它。是否有另一个插件,我可以用来修复它或我可以在文件内手动修复它。我知道问题与插件有关,但可以修复它。

My plugins

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>  
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>

My Jquery codes

<div data-role="page" id="page5" >
    <div data-role="header">
        <h1>Vacancies</h1>
    </div>

    <div data-role="content">
    <h5><span class="glyphicon glyphicon-user"></span>
        <?php  echo 'Welcome '.$_SESSION['username'];

        echo "<br><a href='logout.php' data-ajax='false'>Logout</a>"; ?> ...</h5> 

    <ul data-role="listview" data-inset="true"  data-filter="true" id="jobList">
    <li data-role="list-divider"></li>

    </ul>
    <script>
    addToHomescreen();
    </script>
    </div>   
    <div data-role="footer">
        <h4>&copy;2016 &bull; Genesis M&C Holdings Pty</h4>
    </div>
</div>
<script type="text/javascript">

 $.getJSON("http://localhost:8080//recruitment//jobdetails.json", function(jobs){
   //Start off with an empty list every time to get the latest from server
   $('#jobList').empty();

   //add the job items as list
   $.each(jobs, function(i, job){
     $('#jobList').append(generateJobLink(job));
   });

   //refresh the list view to show the latest changes
  $('#jobList').listview().listview('refresh');    

 });

  //creates a job link list item
 function generateJobLink(job){

  //debugger;
  return '<li><a href="javascript:void(0)'
         + '" onclick="goToJobDetailPage(\''
         + job.jobtype 
         + '\',\''
         + job.city 
         + '\',\''
          + job.message 
         + '\',\''
          + job.details 
         + '\',\''
          + job.jobid 
         + '\',\''


         + job.jobid +'\')">' 
         + job.jobtype+"<h3></h3>"
          + job.city +"<p><strong><br>"
           + job.message +"<h4></h4>"

         + '</a></li>';
  }

  function goToJobDetailPage(jobType,jobCity,jobMessage,jobDetails,jobId){

   //create the page html template
   var jobPage = $("<div data-role='page' data-url=dummyUrl> <div data-role='header'><h1>"
                   + 'Job Details' + "</h1></div><div data-role='content'><strong><form style='border:dotted 1px #CCC' action='jobapp.php' method='post' data-ajax='false'>" 
                   + jobType + "</strong><h6> <input type='hidden' name='jobid'  value='"+ jobId +"' />"
                    + jobId + "</strong><h6> <input type='hidden' name='jobtype'  value='"+ jobType +"' />"
                   + jobCity +"</h6><p> <input type='hidden' name='city'  value='"+ jobCity +"' />"  
                   + jobDetails +"</P><input type='hidden' name='jobid'  value='"+ jobId +"' /><input type='hidden' name='jobtype'  value='"+ jobType +"' /><input type='hidden' name='city'  value='"+ jobCity +"' /> <div class='col-lg-10 text-center'><button type='submit' class='btn btn-warning' id='appbtn' name='appbtn' value='jobapp' data-role='none'><span class='glyphicon glyphicon-envelope'></span>&nbsp;Apply</button><span>&nbsp</span><button type='submit' class='btn btn-danger' id='favbtn' name='favbtn' value='favorite' data-role='none'><span class='glyphicon glyphicon-star'></span>&nbsp;Favorite</button></div></form></div><div data-role='footer'><h4>" 
                   + '&copy;2016 &bull; Genesis M&C Holdings Pty' + "</h4></div></div>");

   //append the new page to the page container
   jobPage.appendTo( $.mobile.pageContainer );

  //go to the newly created page
  $.mobile.changePage( jobPage );
  }  

</script> 

0 个答案:

没有答案