简体   繁体   中英

site works in firefox but no other browsers, why?

should do this:

a progress bar appears, followed by thunbnails.. if it' working.

应该看起来像这样

Can someone please simply explain to me what i have written wrong in my markup? I don't understand what might be the issue here so I am asking here,

My site: http://env-3884279.jelastic.servint.net/bot2/

if the 0% does not appear, it's working incorrectly,

refuses to run in any other browser except firefox. why?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>capri</title>

    <!-- Bootstrap -->
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

  </head>
  <body class="container" style="background-color: white; color: #333; font-family: 'Segoe UI';">

      <br /><br />

      <div>  
          <div id="status" class="pull-left"></div>
          <div id="total" class="pull-right bg-success table-bordered" style="padding: 6px;">0 Movies Processed.</div>
          <div class="clearfix"></div>

          <br />
          <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">        
          </div>
      </div>

      <br />
      <div class="clearfix"></div>

      <div class="row-fluid" id="pagelist" style="border-top: solid whitesmoke 4px;">          
      </div>


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

     <script>
         var processed = 0;
         function ScanPage(pagenum, callback) {

             $("#status").html("Please Wait... ");
             $('.progress-bar').hide();
             $('.progress-bar').css('width', 0 + '%').attr('aria-valuenow', 0).html(0 + '%');

             $.ajax({
                 url: "movies/merdb/scanpage.php?token=" + Math.random() + "&p=" + pagenum,
                 cache: false,
                 async: true,
                 type: "GET"
             }).done(function (html) {
                 var done = 0;
                 var json = JSON.parse(html);
                 var count = Object.keys(json).length;

                 $('.progress-bar').show();

                 $.each(json, function (iter) {
                     $.ajax({
                         url: "movies/merdb/parsepageresults.php?token=" + Math.random() + "&match=" + json[iter],
                         cache: false,
                         async: false,
                         type: "GET"
                     }).done(function (response) {

                         if (response != undefined && response != "") {
                             $("#status").html("<i class=\"fa fa-spinner fa-spin\"></i> Page <span class=\"badge\" style=\"background-color: whitesmoke; font-size: 16px;color: black;\">" + pagenum + "</span> Processing " + (done + 1) + " of " + count);
                             $("#pagelist").append("<div style=\"padding: 5px;\" class=\"col-xs-2\"><img src=" + response + " width=\"150\" height=\"225\"></div>");

                             var vpercent = parseInt(done * 100 / count);
                             $('.progress-bar').css('width', vpercent + '%').attr('aria-valuenow', vpercent).html(vpercent + '%');
                         }


                         done++;

                         processed++;
                         $("#total").html(processed + " Movies Processed.");

                     });
                 });

                 $("#status").html("Scanning Page " + pagenum + " has completed. <span class=\"glyphicon glyphicon-ok\" style=\"color: green\">&nbsp;</span>");

                 callback(pagenum + 1); 
               });
         }

         function Begin(index) {
             ScanPage(index, OnCompleted);
         }

         function OnCompleted(index)
         {
             $("#pagelist").html("");
             Begin(index);
         }


         Begin(1);



     </script>


  </body>
</html>

尝试将所有脚本的<script src="https://aja....放在顶部。

Remove the

$('.progress-bar').hide(); 

if you want to see the 0%

Also the base64 returned is not correct and chrome is trying to download from a url

you are getting

"data:jpg;base64,......"

when you should be getting

"data:image/jpg;base64,...."

Your Ajax minified java script is not responding properly. Try to put both minified java script in head section of HTML. Try to download and save the minified code and run it through your machine so process will be little faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM