I'm getting an unterminated string literal error in Firebug:
我在Firebug中得到一个未终止的字符串文字错误:
Unterminated string literal
$(".search_info").html("<div id=\'sear...arm_bg.png?1279054090\" style=\"displ\n
This error is being rendered from clicking on a Sort By that toggles 'Most Recent'
通过切换到“最近的”,单击排序将呈现此错误
I have narrowed it down to the 'about_us' text. By removing certain parts of the text, I can get it to work. But it's not because of certain words or characters. It's just how the end result is parsed on the search results (and I'm guessing their alignment).
我把范围缩小到“about_us”文本。通过删除文本的某些部分,我可以让它工作。但这并不是因为某些词或字符。这就是最终结果在搜索结果上的解析方式(我猜是它们的对齐方式)。
It gets trickier. I can't reproduce the error on my local machine. It only errors on the server.
它将变得更加棘手。我无法在本地机器上重现错误。它只会在服务器上出错。
The Rails call:
Rails调用:
%li
= image_tag('sortIcon-recent.png')
= search_sort 'Most Recent', 'published_at', 'desc'
Search Sort Helper
搜索排序辅助
def search_sort(name, sort_by, order = 'asc')
if params[:order_by] && params[:order_by] == sort_by
link_to(name, url_for(:overwrite_params => { :order_by => sort_by, :direction => order, :page => nil }), :class => 'selected live')
else
link_to(name, url_for(:overwrite_params => { :order_by => sort_by, :direction => order, :page => nil }), :class => 'live')
end
end
The Javascript call:
Javascript调用:
== $("#search_sort").html("#{ escape_javascript(render :partial => 'search_sort') }");
Further notes: 1. The text is placed in CKeditor. 2. It's parsed using Ruby's truncate command ( which has a history of destroying WYSIWYG text by adding hidden characters into it )
进一步指出:1。文本放在CKeditor中。2。它使用Ruby的truncatetable命令进行解析(该命令通过添加隐藏字符来破坏WYSIWYG文本)
As far as an answer goes, does anyone know how I can further debug this, or what to do from here?
就答案而言,有人知道我如何进一步调试它吗?
Here is the full extracted GET request ( I have read these several times over and can not find an unterminated string literal ) :
这里是完整的提取的GET请求(我已经读了好几遍,但找不到未终止的字符串文字):
$(".search_info").html("<div id=\'searchWindow\'>\n<div id=\'searchContent\'>\n<div class=\'search_result\'>\n<img alt=\"Farm_bg\" class=\"search_image_banner\" height=\"204\" src=\"/system/search_images/993/cropped/farm_bg.png?1279054090\" style=\"display: none;\" width=\"285\" />\n<div class=\'grid_8 alpha\'>\n<div class=\'left\'>\n<img alt=\"Farm_bg\" src=\"/system/search_images/993/thumb/farm_bg.png?1279054090\" />\n<\/div>\n<div class=\'grid_3 omega\'>\n<h1><a href=\"/organizations/coviellobrothers\">Coviello Brothers <\/a><\/h1>\n<div class=\'clear\'><\/div>\n<h3>Madison<\/h3>\n<div class=\'clear\'><\/div>\n<div class=\'class7\'>\nJust This And Much More\n<\/div>\n<div class=\'clear\'><\/div>\n<\/div>\n<div class=\'grid_4 omega alpha\'>\n<div class=\'left\' style=\'margin-right: 12px; width: 40px\'>\n \n<\/div>\n<div class=\'left\' style=\'margin-right: 12px; width: 40px\'>\n<a href=\"/organizations/993/deals/view\"><img alt=\"Hq-card-icon\" src=\"/images/hq-card-icon.png?1279112378\" /><\/a>\n<\/div>\n<div class=\'left\' style=\'margin-right: 12px; width: 40px\'>\n \n<\/div>\n<div class=\'clear\'><\/div>\n<\/div>\n<div class=\'grid_4 omega alpha\' style=\'height: 25px; overflow: hidden;\'>\n<p>\n Coviello Brothers serving Landscape Customers For Over 30 Years\n \n \n located In Madison, C...<\/p>\n<\/div>\n<div class=\'clear\'><\/div>\n<\/div>\n<div class=\'clear\'><\/div>\n<\/div>\n<div class=\'clear\'><\/div>\n<\/div>\n<\/div>\n<div class=\'clear\'><\/div>\n<br />\n<div class=\'align_right\'><\/div>\n<div class=\'clear\'><\/div>\n");
$("#search_sort").html("<div class=\'class7\'>\nSort By:\n<\/div>\n<div class=\'clear\'><\/div>\n<div id=\'sort\' style=\"background: url(\'/images/sort-box-large.png\') no-repeat; padding: 15px 10px\">\n<ul>\n<li>\n<img alt=\"Sorticon-24hr\" src=\"/images/sortIcon-24hr.png?1279112378\" />\n<a href=\"/organizations/search?_=1279118265076&commit=go&direction=desc&order_by=contactable&q=coviello+brothers\" class=\"live\">24hr Contact<\/a>\n<\/li>\n<li>\n<img alt=\"Sorticon-card\" src=\"/images/sortIcon-card.png?1279112378\" />\n<a href=\"/organizations/search?_=1279118265076&commit=go&direction=desc&order_by=best_deal_score&q=coviello+brothers\" class=\"live\">HQcard Promotion<\/a>\n<\/li>\n<li>\n<img alt=\"Sorticon-video\" src=\"/images/sortIcon-video.png?1279112378\" />\n<a href=\"/organizations/search?_=1279118265076&commit=go&direction=desc&order_by=number_of_videos&q=coviello+brothers\" class=\"live\">Video<\/a>\n<\/li>\n<li>\n<img alt=\"Sorticon-trust\" src=\"/images/sortIcon-trust.png?1279112378\" />\n<a href=\"/organizations/search?_=1279118265076&commit=go&direction=desc&order_by=rating&q=coviello+brothers\" class=\"live\">Trust Ranking<\/a>\n<\/li>\n<li>\n<img alt=\"Sorticon-recent\" src=\"/images/sortIcon-recent.png?1279112378\" />\n<a href=\"/organizations/search?_=1279118265076&commit=go&direction=desc&order_by=published_at&q=coviello+brothers\" class=\"selected live\">Most Recent<\/a>\n<\/li>\n<li>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\'clear\'><\/div>\n");
$("#search_pagination").html("");
$("#search_total h6").html("1 Result Returned!");
$("#middle_search_banner").html("<img alt=\"Farm_bg\" height=\"204\" id=\"search_image_banner\" src=\"/system/search_images/993/cropped/farm_bg.png?1279054090\" width=\"285\" />\n");
Here is the text that breaks it (this was pasted as plain text in CKeditor ). Also, as a reminder, I tried removing the ":" and other characters, but it still produced the same error:
这是破坏它的文本(这是在CKeditor中粘贴的纯文本)。另外,作为提醒,我试着删除“:”和其他字符,但它仍然产生相同的错误:
Coviello Brothers Serving Landscape Customers for over 30 years. Located in Madison, Coviello Brothers is a full service design and build landscape business that is family owned and operated since 1973. We have a licensed landscape architect on staff to assist you with your design ideas. We are licensed for irrigation installation, pesticide application, and certified for stone wall construction. We offer a full range of landscaping services including:
科维耶洛兄弟 景观服务客户了30多年。Coviello Brothers位于美国麦迪逊市,自1973年以来,Coviello Brothers一直致力于为客户提供全方位的服务设计,并致力于打造家族企业。我们有一个持牌的景观设计师在员工中协助你的设计想法。 我们安装许可用于灌溉,农药应用程序和认证的石墙建设。我们提供全方位的景观美化服务,包括:
1 个解决方案
#1
5
you have an unterminated string literal:
你有一个不终止字符串文字:
$(".search_info").html("<div id=\'sear...arm_bg.png?1279054090\" style=\"displ\n
$(" .search_info”)。html(“< div id = \ '烤焦…arm_bg.png ?1279054090 \“风格= \”displ \ n
id opens with '
and closes with "
id打开,然后关闭
#1
5
you have an unterminated string literal:
你有一个不终止字符串文字:
$(".search_info").html("<div id=\'sear...arm_bg.png?1279054090\" style=\"displ\n
$(" .search_info”)。html(“< div id = \ '烤焦…arm_bg.png ?1279054090 \“风格= \”displ \ n
id opens with '
and closes with "
id打开,然后关闭