TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Forum diskusi pemrograman web PHP

Moderators: irzan2010, trail

TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby alfwtz » 16 Jan 2012, 22:23

tombol upload tidak bisa menampilkan photo jika dijalankan di browser selain google chrome, ini scriptnya:
Code: Select all
<script type="text/javascript">
   /**
   * <![CDATA[  **/
      $(function() {
      $('img#pasphoto').attr({'src' : '<?=$self->url->images?>/none.png?' + new Date().getTime() });            
                var upload = $('#uploads'), interval;
      new AjaxUpload(upload, {
               action: '<?=$self->url->root?>/data/upload',
               onSubmit : function(file , ext){
                  if (ext == "jpg" || ext == "JPG" ){
                     upload.text('Uploading ' + file);
                  } else {               
                     upload.text('Error: only jpg images are allowed');
                     return false;            
                  }      
               },
               onComplete : function(file){
                  $('img#pasphoto').attr({
                     'src' : '<?=$self->url->root?>/cache/<?= $_SESSION['token'] ?>.jpg?' + new Date().getTime()
                  });            
                  upload.text('Ganti Foto');
                  $("<div title='Preview'><img src='<?=$self->url->root?>/cache/<?=$_SESSION['token']?>.jpg?"+new Date().getTime()+"'></div>")
                  .dialog({modal:true, height: 'auto', width: 'auto', resizable: false});
         }      
      });

         $('#accordion').accordion({autoHeight:false,icons:{header:"ui-icon-circle-arrow-e",headerSelected:"ui-icon-circle-arrow-s"}});
         $('input.ui-state-default, .button-ui, textarea.ui-state-default').hover(function(){
            $(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');
         });
         $('#tanggal, #tanggallahir').datepicker({
            dateFormat:'yy-mm-dd',showOn:'button',buttonImage:'<?= $self->url->root ?>/assets/images/calendar.gif',buttonImageOnly: true
         });
         $('#postbutton').click(function(){
            if ( $('#kode').val() == "" || $('#nama').val() == "" || $('#kunci_nisn').val() == "" || $('#ayah').val() == "" || $('#ibu').val() == "" || $('#alamatortu').val() == "" || $('#namasekolah').val() == "" || $('#tempatlahir').val() == "") {
               $('<div title="error input"><h2 align="center">data ppdb belum valid disimpan</h2></div>')
                  .dialog({
                     resizable:false, modal:true,
                     buttons: {'kembali': function() { $(this).dialog('close'); }},
                     close: function(){ $('#loginID').focus(); }
                  });
           }else{
            var postData = {} ;
            $.each($('#accordion input'), function() {
               postData[this.id] = $(this).val();
            });            
            $.each($('#accordion select'), function() {
               postData[this.id] = $(this).val();
            });
            $.each($('#accordion textarea'), function() {
               postData[this.id] = $(this).val();
            });
            
            $.post('<?=$self->url->root?>/data/pendaftaran', postData, function(data) {
               $('<div title="ppdb smanda">'+data+'</div>')
               .dialog({
                  resizable: false, width: 'auto', modal: true,
                  buttons: {
                     'cetak formulir': function() {
                        window.open('<?=$self->url->root?>/data/cetak/'+ $('#kode').val());
                        $(this).dialog('close');
                     }
                  },
                  close: function(){
                     $('#accordion').effect('explode',{},500,function(){ location.href = '' });
                  }
               });
            });
         }});
         $('#telepon, #anakke, #teleponortu, #teleponwali, .nilaiTable input').keyup(function() {
            if(this.value != "" && !/^[0-9]+$/.test(this.value)) {
               $(this).addClass('ui-state-error');
            } else {
               $(this).removeClass('ui-state-error');
            }
         });
         $('#accordion').draggable({snap:true, handle:'h3', cursorAt: { cursor: 'move' }});
         $('.nilaiTable input').focus(function(){ this.value = ''; }).blur(function(){ (this.value == '' ) ? this.value = '0.0' : this.value = this.value; });
      });
   /**
   * ]]>  **/
</script>

saya coba di firefox yang telah saya install java juga ga bisa, mohon koreksi dari master2 :)
vulkanisir|software|networking
alfwtz
Prajurit Dua
Prajurit Dua
 
Posts: 22
Joined: 12 May 2011, 16:01
Location: palembang
Memberi kopi: 0 cangkir
Mendapat kopi: 1 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby alfwtz » 16 Jan 2012, 22:37

ini script actionnya:
Code: Select all
<h3><a href="#">Konfirmasi Akhir.</a></h3>
   <div>
      <table width="100%">
         <tr>
            <td width="60" align="center">
               <img width="100" id="pasphoto" style="display:block;border:1px #ccc solid;margin:10px;"/>
                                        <br  class="ui-helper-clearfix" />
               <button id="uploads" class="button-ui ui-corner-all">upload photo</button>
            </td>
            <td valign="bottom" align="right"><button id="postbutton" class="button-ui ui-state-default ui-corner-all">simpan data</button></td>
         </tr>
      </table>
   </div>
vulkanisir|software|networking
alfwtz
Prajurit Dua
Prajurit Dua
 
Posts: 22
Joined: 12 May 2011, 16:01
Location: palembang
Memberi kopi: 0 cangkir
Mendapat kopi: 1 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby alfwtz » 20 Jan 2012, 14:14

salah kamar atau lagi sepi :-?
vulkanisir|software|networking
alfwtz
Prajurit Dua
Prajurit Dua
 
Posts: 22
Joined: 12 May 2011, 16:01
Location: palembang
Memberi kopi: 0 cangkir
Mendapat kopi: 1 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby vberror13 » 20 Jan 2012, 18:25

Cross browser javascript memang kadang menyulitkan, oom.
Coba aja test dulu pake browser lain, dan lihat error messagenya. Kalau di firefox, biasanya kalau ada error bisa dilihat di menu Tools>Error Console. Kalau di ie7+ saya nggak ingat. tapi biasanya kalo error ada tanda segitiga warna kuning di kiri bawah browser.

nah, di browser yang lain itu kalo nggak bisa pasti karena ada error. coba oom copy-paste errornya di sini, biar lebih gampang dianalisis.
:ymbilly: :ymbilly: :ymbilly: =:) :ymbilly:
Just Because You Are Unique, Doesn't Mean You Are Useful
User avatar
vberror13
Global Moderator
Global Moderator
 
Posts: 1847
Joined: 13 Mar 2010, 20:34
Location: Medan Indonesia
Memberi kopi: 296 cangkir
Mendapat kopi: 321 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby alfwtz » 21 Jan 2012, 16:07

hasil error concole di firefox:
Warning: Unknown property 'zoom'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/ui.jqgrid.css Line: 1
Warning: Error in parsing value for 'width'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/ui.jqgrid.css Line: 1
Warning: Error in parsing value for 'height'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/ui.jqgrid.css Line: 1
Warning: Error in parsing value for 'width'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/ui.jqgrid.css Line: 1
Warning: Error in parsing value for 'height'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/ui.jqgrid.css Line: 1
Warning: Unknown property '-moz-opacity'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/jquery.jcarousel.css Line: 108
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/jquery.jcarousel.css Line: 109
Warning: Unknown property '-moz-opacity'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/jquery.jcarousel.css Line: 131
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/jquery.jcarousel.css Line: 132
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 18
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 74
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 282
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 347
Warning: Unknown property 'zoom'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 360
Warning: Unknown property 'zoom'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/smo ... custom.css Line: 398
Warning: Unknown property '-moz-opacity'. Declaration dropped.
Source File: http://localhost/ppdb/assets/themes/coffee/grid.css Line: 197
Warning: Unknown property '-moz-outline-style'. Declaration dropped.
Source File: http://localhost/ppdb/assets/css/main.css Line: 3
You do not have the required permissions to view the files attached to this post.
vulkanisir|software|networking
alfwtz
Prajurit Dua
Prajurit Dua
 
Posts: 22
Joined: 12 May 2011, 16:01
Location: palembang
Memberi kopi: 0 cangkir
Mendapat kopi: 1 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby vberror13 » 23 Jan 2012, 00:53

:-? saya lihat ini cuma kesalahan di CSS aja. Firefox tidak support css "expression()" yang di buat di file .css-nya, property zoom dan -moz-opacity juga tidak disupport oleh firefox.
Cuma saya agak heran, ini css di dapat dari mana sih? soalnya '-moz-opacity' dinyatakan tidak sebagai "unknown property" di firefox. Kalo firefox versi yang lama memang support css itu. tapi yang sekarang '-moz-opacity' di firefox udah dinamakan sebagai 'opacity' saja.
Artinya css itu ditujukan untuk browser-browser lama. Css expression juga tidak disupport lagi oleh IE8 (browser IE versi sebelumnya memang support ).

Saya sendiri tidak yakin gara-gara CSS yang salah, javasscriptnya juga ngulah. Tapi coba aja deh buang semua css yang nggak disupport oleh firefox, dan lihat apakah ajax uploadnya bisa jalan atau tidak.
simplenya, bila ada baris css yang kayak gini:
Code: Select all
.myclass
{
   text-align:center;
   zoom:1;
}

yang baris terakhir (zoom:1) dihilangkan.

btw, ini phpnya pake framework apa? CI ? Prado ? YII ?
:ymbilly: :ymbilly: :ymbilly: =:) :ymbilly:
Just Because You Are Unique, Doesn't Mean You Are Useful
User avatar
vberror13
Global Moderator
Global Moderator
 
Posts: 1847
Joined: 13 Mar 2010, 20:34
Location: Medan Indonesia
Memberi kopi: 296 cangkir
Mendapat kopi: 321 cangkir

Re: TIDAK BISA UPLOAD PHOTO SELAIN CHROME

Postby alfwtz » 25 Jan 2012, 11:55

ga make framework, build from scrath, ok saya coba dulu om, thanks pencerahannya
vulkanisir|software|networking
alfwtz
Prajurit Dua
Prajurit Dua
 
Posts: 22
Joined: 12 May 2011, 16:01
Location: palembang
Memberi kopi: 0 cangkir
Mendapat kopi: 1 cangkir


Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests