Hi!
I got an error in my app, when Im adding a produt to my cart Im using some AJAX to first show the cart and then lighten up the new added product in the cart.
But when i add a new product to cart; I have to refresh my page so I can see the new product, because the AJAX doesnt work... It works on my development computer but not in the production server, maybe its something with the new Ruby version: 1.8.7.
Is this code correct?!
My add_to_cart.rjs:
page.select("div#notice").each { |div| div.hide } <--- If cart is empty it doesnt show the cart
page.replace_html("cart", :partial => "cart",
bject => @cart)
page[:cart].visual_effect :blind_down if @cart.total_items == 1
page[:current_item].visual_effect :highlight,
:startcolor => "#8a9546",
:endcolor => "#efeab0"
From the production.LOG
[code=]Processing StoreController#add_to_cart (for 83.254.103.73 at 2009-02-17 22:00:11) [POST]
Session ID: BAh7CDoMY3NyZl9pZCIlYjY4Mzk0M2JlM2YyZTg3OWRlMzc4ZWU5ZDc5ZmUx%0AYmQ6CWNhcnRvOglDYXJ0BjoLQGl0ZW1zWwAiCmZsYXNoSUM6J0FjdGlvbkNv%0AbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%3D--eb9fcfaa057def84ec7387692c8ff4084cfd8f7d
Parameters: {"commit"=>"K
Last edited by depe86 (2009-02-18 14:03:38)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
At last I got the error fixed. I think I was trying for 24h
The problem is with the AJAX function "page.select" when using Ruby 1.8.7...
Copy this code to the environment.rb.
unless '1.9'.respond_to?(:force_encoding)
String.class_eval do
begin
remove_method :chars
rescue NameError
# OK
end
end
end
分享到:
相关推荐
详细解读Jquery各Ajax函数:$.get(),$.post(),$.ajax(),$.getJSON()
NULL 博文链接:https://chun521521.iteye.com/blog/1935516
《Ajax实战:实例详解》sources 全部源码
零基础学Java.Web开发:JSP.Servlet.Struts.Spring.Hibernate.Ajax(PPT).
《ASP.NET.AJAX程序设计.第II卷.客户端Microsoft.AJAX.Library与异步通信层》pdf版part2
xxi Chapter 1: Introduction to ASP.NET AJAX. . . . . 1 Chapter 2: Creating an ASP.NET AJAX Application. .11 Chapter 3: ASP.NET AJAX Architecture. . . . . . 。33 Chapter 4: Calling Web ...
NULL 博文链接:https://linwei-211.iteye.com/blog/1567277
jquery中ajax请求后台数据成功后既不执行success也不执行error,此外系统报错:Uncaught SyntaxError: Unexpected identifier at Object.success,但后台能够返回数据,原代码如下: var source=[]; $.ajax({ ...
1.添加引用:Ajax.Pro.2.DLL. 2.在Web.Config:<system.web> ,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/> </system.web> 3.使用的时候在Pageload方法中添加:AjaxPro....
Ext Ajax:如何调用Ext.Ajax.request方法和使用Java Servlet进行处理
1 Using Ajax: Web Apps for a New Generation 1 2 Designing Ajax Applications: Thinking Ajaxian 43 3 Javascript Events: Reacting to your users 93 4 Multiple Event Handlers: Two’s Company 139 5 ...
0Java.Web开发:JSP.Servlet.Struts.Spring.Hibernate.Ajax电子文档
vs2008中 Ajax错误: Sys未定义 vs2008中 Ajax错误: Sys未定义
Chapter 7: AJAX. Chapter 8: Filters. Chapter 9: Securing Your Application. Chapter 10: Test Driven Development With ASP.NET MVC. Chapter 11: Testable Design Patterns. Chapter 12: Best of Both ...
《疯狂Ajax讲义:Prototype/jQuery+DWR+Spring+Hibernate整合开发》是《基于J2EE的Ajax宝典》的第二版。《基于J2EE的Ajax宝典》面市近2年,作为Ajax领域最全面、实用的图书,一直深受读者的好评。全书主要分为三个...
<script type="text/javascript" src="Ajax/Ajax.js"></script> // 配套的 js <script type="text/javascript" src="Ajax/Handler.ashx"></script> // 第 3 步中的一般处理程序(注意 url 中不带任何传参) 例...
零基础学Java[1].Web开发:JSP.Servlet.Struts.Spring.Hibernate.Ajax
今天在使用 ajax 向后台请求数据时出现错误,提示状态码为 0 ,后台采用的是 spring mvc 架构。 状态码为0是什么意思呢?查找了下,原来它意味着 (未初始化)即没有调用到send()方法,我原来代码如下 : $.ajax...
零基础学Java.Web开发:JSP.Servlet.Struts.Spring.Hibernate.Ajax(PPT) 的配套PPT,不错的提纲
《疯狂Ajax讲义:Prototype/jQuery+DWR+Spring+Hibernate整合开发》是《基于J2EE的Ajax宝典》的第二版。《基于J2EE的Ajax宝典》面市近2年,作为Ajax领域最全面、实用的图书,一直深受读者的好评。全书主要分为三个...