2016-12-10 28 views
0

http://phpcodechecker.com/は、「通知」は私のコードで(T_STRING)と言います。私は何に置き換えるべきですか?私のonClick構文に何が間違っていますか?

<?php 
    $Query = $this->DBase('Query', array(0 => "SELECT * FROM `factions`")); 
    while ($FACTIONS = $Query->fetch_object()) { 
     $this->FACTION->FACTIONSLIST .= 
     '<tr class="even pointer"> 
      <td width="1%" class="a-center "><input type="checkbox" class="flat" name="table_records"></td> 
      <td width="10%">{$FACTIONS->id}</td> 
      <td>{$FACTIONS->Name} </td> 
      <td width="5%" class="last"> 
       <a href="{SITE_CMS_ROOT}?factions&edit={$FACTIONS->id}"> 
      &nbsp;<i class="fa fa-pencil"></i> 
       </a> 
      &nbsp;&nbsp;&nbsp;&nbsp; 
      <a href="{SITE_CMS_ROOT}?factions&delete={$FACTIONS->id} onclick="alert(Alrt Text!);"></a> 
       <a href="#" onclick="new TabbedNotification([ 
        title: 'Notification', 
        text: 'Faction 123 successfully deleted!, page will be updated shortly.', 
        type: 'Error', 
        sound: false 
       ]);"> 
        <i class="fa fa-trash-o"></i> 
       </a> 
      </td> 
     </tr>'; 
    }  
?> 

ここには、onClickスクリプトを使用したHTMLがあります。 {SITE_FACTIONS}は、onClick機能を持つPHPスクリプトです。

<body class="nav-md"> 
    <div class="container body"> 
     <div class="main_container"> 
      {SITE_SIDEBAR} 
      {SITE_NAVIGATION} 
      <div class="right_col" role="main"> 
       <div class=""> 
        <div class="page-title"> 
         <div class="title_left"> 
          <h3> </h3> 
         </div> 
         <div class="title_right"> 
          <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search"> 
           <div class="input-group"> 
            <input type="text" class="form-control" placeholder="Search for..."> 
            <span class="input-group-btn"> 
             <button class="btn btn-default" type="button">Go!</button> 
            </span> 
           </div> 
          </div> 
         </div> 
        </div> 
        <div class="clearfix"></div> 
        <div class="row"> 
         <div class="clearfix"></div> 
         {SITE_FACTIONS} 
        </div> 
       </div> 
      </div> 
      {SITE_FOOTER} 
     </div> 
    </div> 

<div id="custom_notifications" class="custom-notifications dsp_none"> 
    <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group"> 
    </ul> 
    <div class="clearfix"></div> 
    <div id="notif-group" class="tabbed_notifications"></div> 
</div> 

<!-- jQuery --> 
<script src="{SITE_CMS_ROOT}vendors/jquery/dist/jquery.min.js"></script> 
<!-- Bootstrap --> 
<script src="{SITE_CMS_ROOT}vendors/bootstrap/dist/js/bootstrap.min.js"></script> 
<!-- FastClick --> 
<script src="{SITE_CMS_ROOT}vendors/fastclick/lib/fastclick.js"></script> 
<!-- NProgress --> 
<script src="{SITE_CMS_ROOT}vendors/nprogress/nprogress.js"></script> 
<!-- bootstrap-progressbar --> 
<script src="{SITE_CMS_ROOT}vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script> 
<!-- iCheck --> 
<script src="{SITE_CMS_ROOT}vendors/iCheck/icheck.min.js"></script> 
<!-- PNotify --> 
<script src="{SITE_CMS_ROOT}vendors/pnotify/dist/pnotify.js"></script> 
<script src="{SITE_CMS_ROOT}vendors/pnotify/dist/pnotify.buttons.js"></script> 
<script src="{SITE_CMS_ROOT}vendors/pnotify/dist/pnotify.nonblock.js"></script> 

<!-- Custom Theme Scripts --> 
<script src="{SITE_CMS_ROOT}build/js/custom.min.js"></script> 

<!-- Custom Notification --> 
<script> 
    $(document).ready(function() { 
    var cnt = 10; 

    TabbedNotification = function(options) { 
     var message = "<div id='ntf" + cnt + "' class='text alert-" + options.type + "' style='display:none'><h2><i class='fa fa-bell'></i> " + options.title + 
     "</h2><div class='close'><a href='javascript:;' class='notification_close'><i class='fa fa-close'></i></a></div><p>" + options.text + "</p></div>"; 

     if (!document.getElementById('custom_notifications')) { 
     alert('doesnt exists'); 
     } else { 
     $('#custom_notifications ul.notifications').append("<li><a id='ntlink" + cnt + "' class='alert-" + options.type + "' href='#ntf" + cnt + "'><i class='fa fa-bell animated shake'></i></a></li>"); 
     $('#custom_notifications #notif-group').append(message); 
     cnt++; 
     CustomTabs(options); 
     } 
    }; 

    CustomTabs = function(options) { 
     $('.tabbed_notifications > div').hide(); 
     $('.tabbed_notifications > div:first-of-type').show(); 
     $('#custom_notifications').removeClass('dsp_none'); 
     $('.notifications a').click(function(e) { 
     e.preventDefault(); 
     var $this = $(this), 
      tabbed_notifications = '#' + $this.parents('.notifications').data('tabbed_notifications'), 
      others = $this.closest('li').siblings().children('a'), 
      target = $this.attr('href'); 
     others.removeClass('active'); 
     $this.addClass('active'); 
     $(tabbed_notifications).children('div').hide(); 
     $(target).show(); 
     }); 
    }; 

    CustomTabs(); 

    var tabid = idname = ''; 

    $(document).on('click', '.notification_close', function(e) { 
     idname = $(this).parent().parent().attr("id"); 
     tabid = idname.substr(-2); 
     $('#ntf' + tabid).remove(); 
     $('#ntlink' + tabid).parent().remove(); 
     $('.notifications a').first().addClass('active'); 
     $('#notif-group div').first().css('display', 'block'); 
    }); 
    }); 
</script> 
<!-- /Custom Notification --> 

答えて

0

chnageこの:

title: 'Notification', 
text: 'Faction 123 successfully deleted!, page will be updated shortly.', 
type: 'Error', 

へ:

title: "Notification", 
text: "Faction 123 successfully deleted!, page will be updated shortly.", 
type: "Error", 
+0

をしかしonclickの機能は今では文句を言わないすべてのエラーを表示し、単一引用 –

0

あなたは2 '(単一引用符)の間'(単一引用符)を使用している場合は、あなたがしなければなりません一重引用符をエスケープします。

title: \'Notification\', 
text: \'Faction 123 successfully deleted!, page will be updated shortly.\', 
type: \'Error\', 
+0

を受け入れますが、onClickのは文句を言わない私のポップアップ/粘着性を示しています。このようにしてみてください。私のポップアップスクリプトをチェックできますか? –

+0

ブラウザのコンソールを確認してください。何かエラーがありますか? –

+0

inspect要素とUncaught SyntaxErrorにエラーがあります。予期しないトークン: –

関連する問題