使用jquery返回css格式的coldfusion结果
好的,我做了这个jquery,结果很好,但是css没有得到应用。有没有办法将css应用于结果使用jquery返回css格式的coldfusion结果,jquery,css,coldfusion,Jquery,Css,Coldfusion,好的,我做了这个jquery,结果很好,但是css没有得到应用。有没有办法将css应用于结果 function doSearch() { //Send the AJAX call to the server $.ajax({ //The URL to process the request 'url' : 'cf/inventoryQuery.cfm', //The type of request, also known as the "method" in HTML for
function doSearch() {
//Send the AJAX call to the server
$.ajax({
//The URL to process the request
'url' : 'cf/inventoryQuery.cfm',
//The type of request, also known as the "method" in HTML forms
//Can be 'GET' or 'POST'
'type' : 'POST',
//Any post-data/get-data parameters
//This is optional
'data' : $("#SearchInventory").serialize(),
//The response from the server
'success' : function(data) {
$('#Results').html(data);
}
});
}
编辑-这是获取新内容的div
<div id="Results" >
<cfoutput query="queryCars" maxrows="4">
<div class="Result">
<img src="images/samplecar.png" />
<div class="ResultText">
#strYear# #strMake# #strModel#
</div>
</div>
</cfoutput>
</div>
#strYear##strMake##strModel#
AJAX调用返回的结果如下所示
<cfoutput query="queryCars" maxrows="4">
<div class="Result">
<img src="images/samplecar.png" />
<div class="ResultText">
#strYear# #strMake# #strModel#
</div>
</div>
</cfoutput>
#strYear##strMake##strModel#
所以它实际上是用完全相同的东西替换一件东西。我的呼叫页面有一个
在标题中 ajax调用看起来像是从CF返回HTML。因此基本上,您有两个选项
标记中生成css,并将其与查询表一起返回.cfm
生成的结果使用相同的预定义类ajax调用看起来像是从CF返回HTML。因此,基本上,您有两个选项
标记中生成css,并将其与查询表一起返回.cfm
生成的结果使用相同的预定义类这就是让人困惑的地方——调用它的页面正在用新的查询结果替换一个div——放置在div中的项具有所有相同的类。我按照您的建议包括了样式标记。很好。这就是令人困惑的地方——调用它的页面正在用新的查询结果替换一个div——放在div中的项具有所有相同的类。我按照您的建议包括了样式标记。效果很好。