Javascript 正则表达式标志a无效

Javascript 正则表达式标志a无效,javascript,jquery,document-ready,silex,Javascript,Jquery,Document Ready,Silex,我使用Silex Frame Work,并尝试使用以下代码删除表中列出的后端文件,但fire bug向我发送了一条错误消息invalid regular expression flag a,当我单击delete链接时,它将进入一个白色页面。代码为: <script type="text/javascript"> $(document).ready(function(){ $(".delete-file").live('click', function() {

我使用Silex Frame Work,并尝试使用以下代码删除表中列出的后端文件,但fire bug向我发送了一条错误消息invalid regular expression flag a,当我单击delete链接时,它将进入一个白色页面。代码为:

<script type="text/javascript">
    $(document).ready(function(){
        $(".delete-file").live('click', function() {
            itemRow   = $(this).parent().parent().parent();
            fileId    = $(this).attr('file_id');
            deleteURL = $(this).attr('href');

            var html   = "<div> Are you sure, you want to DELETE this file? </div>";
            var dialog = $(html).dialog({
                buttons: {
                    "Ok": function() {
                        $.ajax({
                            url     : deleteURL,
                            type    : 'DELETE',
                            success : function(data) {
                                itemRow.remove();
                                dialog.dialog("close");
                            },
                            error   : function() {
                                dialog.dialog("close");
                            }
                        });
                    },
                    "Cancel": function() {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        });
    });
</script>
我使用:

   {% for row in result %}
       <tr class="content {{ cycle(['odd', 'even'], loop.index) }}">
            <td> {{ row.name }} </td>
            <td> {{ row.user.username }} </td>
            <td class="url"> <a href="{{ path('info', {"id" : row.file_id}) }}">{{ row.path | truncate(30) }}</a> </td>
            <td> <img src="{{conf('base_url')}}/{{row.thumbnail}}"/> </td>
            <td class="url"> {{ row.size | bytes_format}} </td>
            <td> {{ row.description }} </td>
            <td>
                <span><a href="{{ path('delete', {'id' : row.file_id} ) }}" class="delete-file" file-id="{{row.file_id}}">DELETE</a></span>
            </td>
        </tr>
   {% endfor %}

我找到了。这只是因为给了我的.js文件错误的路径

无效的正则表达式标志a[在此错误时中断]/home/saeed/www/karina/moshare/web/scripts/jquery-1.6.2.min.js。。。jquery.min.js第1行,col 6Fire Bug也显示了这个错误:$未定义[Break On this error]$document.readyfunction{正则表达式在哪里?这是一个js正则表达式:/[a-z]\w+/gi gi。末尾的gi是标志,g=global,i=ignore case。它说你在某处有“a”。