无效的正则表达式标志a(invalid regular expression flag a)

编程入门 行业动态 更新时间:2024-10-23 04:34:22
无效的正则表达式标志a(invalid regular expression flag a)

我使用Silex Frame Work,我正在尝试使用以下代码删除表中列出的后端文件,但是火灾错误消息给了我一条错误消息“无效的正则表达式标志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 %}

I use Silex Frame Work and I am trying to delete files in backend that listed in a table using the following code but fire bug is given me an error message "invalid regular expression flag a" And when i click on the DELETE link it goes to a white page.The code is:

<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>

and i use:

{% 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文件提供了错误的路径!

I found it. it's just because of giving wrong path to my .js files!!

更多推荐

本文发布于:2023-07-04 16:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1026895.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标志   正则表达式   invalid   flag   expression

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!