- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
打开下载对话框,以及其他 ajax 怪异-6ren"> 打开下载对话框,以及其他 ajax 怪异-我们最近在我们的服务器上建立了一个新网站:Windows 2K8 R2/IIS7/ColdFusion8 Ent。在本地工作没有问题的关键查询现在在生产中无法工作。 使用下面的 cfc 函数中的 使浏-6ren">
我们最近在我们的服务器上建立了一个新网站:Windows 2K8 R2/IIS7/ColdFusion8 Ent。在本地工作没有问题的关键查询现在在生产中无法工作。
使用<cfcontent type="text/json">
下面的 cfc 函数中的 使浏览器在模板调用此函数时打开下载对话框。
<cffunction name="getPolls" access="remote" returntype="any" hint="Gets Polls">
<cfargument name="poll_id" type="numeric" required="true">
<cfset var qPoll = 0>
<cfquery name="qPoll" datasource="#application.datasource#">
select * from polls where poll_id = #arguments.poll_id#
</cfquery>
<cfcontent type="text/json">
<cfreturn qPoll>
</cffunction>
下面是调用上述函数的 jQuery 代码。当此代码在模板 (test.cfm) 内运行时,下载对话框将打开,要求我保存文件 test.cfm,而不是实际浏览模板。
$(function(){
var poll_id = global_poll_id || 0;
var uniqueid = new Date().getTime();
$.getJSON("/cfcs/poll.cfc?method=getPolls&returnformat=json&queryformat=column&uniqueid=" + uniqueid, {"poll_id":poll_id}, function(res,code) {
alert(res.ROWCOUNT); // error here
})
})
如果我删除 <cfcontent type="text/json">
从功能上来说,不再出现下载对话框;但是,ajax 回调似乎没有触发并且返回错误:
res is not defined
最佳答案
json 的正确 mime 类型是 application/json,因此添加 text/json 可能会导致下载提示,因为此 mime 可能未在 IIS 中映射。
您并不严格需要添加cfcontent
,操作 header 可能是更好的方法。不管怎样,jQuery 都会将其解析为 json。检查网络检查器中的响应和 header ,您可能会找到有关该问题的更多信息。
关于jquery - <cfcontent type ="text/json"> 打开下载对话框,以及其他 ajax 怪异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7454518/
我不明白为什么有两段代码要做完全相同的事情,却在 Scala 中做不同的事情。 第一个例子: scala> val ggg = Source.fromFile("/somefile"); ggg: s
您认为以下结果如何? SELECT CHARINDEX('space and /* comment */', 'Phrase with space and /* comment */') AS Mat
我正在尝试为单元测试创建带有某些修饰符的 MouseEvent。我使用的是 J2SE,以下代码无法通过: public void testMouseEventProblem() { Mouse
为什么输出0而不是1? System.out.println((int) (Math.ceil(1/2))); 虽然这个正确输出 1 System.out.println((int) (Math.ce
如果我运行这段代码: var a = new Float32Array(3); a[0] = 1; a[1] = 1.1; a[2] = 1.00001; 我得到了a的结果: [1, 1.100000
今天刚开始使用“UIRefreshControl”,发现了一些奇怪的事情。 如果我在 InterfaceBuilder 中创建了 UIRefreshControl,并将其连接起来,我的选择器将永远不会
这是一个非常简单的问题,但是 PHP 文档没有解释为什么会这样。 我有这个代码: var_dump($newattributes); var_dump($oldattributes); var_dum
如果我通常加载一个 UITabBarController 并在 View 之间切换,它会调用每个 View Controller 的 viewWillAppear。但事实并非如此。 我想在触摸另一个标
我有一个关于 setContentOffset 的奇怪问题,我似乎无法解决:我正在尝试构建一个“无尽”的 ScrollView ,所以我想在某个位置重置内容偏移量。使用下面的代码,setContent
这个把我难住了。 我有一个 java.sql.ResultSet,我正在从中提取字符串值,如下所示: address.setAddressLine1(rs.getString("AddressLine
...至少对我来说。这段代码曾经工作得很好。我很确定什么都没有改变,但现在突然间它的行为变得奇怪了。基本上我正在尝试创建内联编辑功能。当用户单击该链接时,它会动态生成一个文本框以及一个确认和取消链接。
我在 ldd 中遇到了以下奇怪的情况 $ sudo ldd ./monit not a dynamic executable $ readelf -d monit Dynamic sectio
我的 app.config 文件发生了一件奇怪的事情。我的 ConnectionStrings 部分包含以下内容: 但是,当我通过 ConfigurationManager.Connecti
CSS 不是我的强项,我不确定我的列表项在 IE6 中发生了什么。我希望它们垂直对齐,但第一个列表项总是被向右推一两个像素,因此它不再与列表中的其他成员对齐。就我而言,此列表在 IE7/8、FF3 和
制作了一个网络作品集。我的名字周围有联系方式。文本的初始宽度为 0,当鼠标悬停时,图标会随着“过渡”属性展开。左边的图标工作正常,但右边的图标过渡很奇怪,尤其是手机。 http://jsfiddle.
发生的事情是我遵循了这个demo ,我修改了它以满足我的需要,让它工作,将其更改为使用函数绘制两个图形,但现在使用 plt.show() 或 plt 根本不起作用。 savefig() 这是我的代码
我正在尝试编写一个从整数中提取最低阶数的函数。例如: > 24689.lowest_order => 9 到目前为止我有: class Integer def lowest_order I
不确定这是包中的错误还是由于其他原因,但我们开始吧。 我正在使用以下包在相似性分数的对称矩阵(大小为 10x10)上查找最大特征值及其对应的特征向量: scipy.sparse.linalg.eige
我正在尝试实现一个名为“inet_pton”的函数,它将 IPv4 或 IPv6 的字符串表示形式(如“66.102.1.147”[google])转换为二进制网络字节有序形式。这是我的代码的相关部分
比较 float 。根据第一个代码块,5 大于 37.66。第二个 block 声称 5 小于 37.66。 toFixed() 对这些使第一个 block 按照它的方式使用react的是什么? (这
我是一名优秀的程序员,十分优秀!