首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无效的正则表达式标志a

无效的正则表达式标志a
EN

Stack Overflow用户
提问于 2012-05-01 15:59:51
回答 1查看 4.2K关注 0票数 1

我使用Silex框架,我试图删除后端的文件,这些文件列在一个表格中,使用下面的代码,但是fire bug给了我一个错误信息"invalid regular expression flag a“,当我点击delete链接时,它转到一个白色的page.The代码是:

代码语言:javascript
运行
复制
<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>

我使用:

代码语言:javascript
运行
复制
   {% 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 %}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-20 20:55:13

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10395081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档