Pat*_*urg 1 css coldfusion jquery
好吧,所以我做了这个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 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);
}
});
}
Run Code Online (Sandbox Code Playgroud)
编辑 - 这是获取新内容的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>
Run Code Online (Sandbox Code Playgroud)
从AJAX调用返回的结果如下所示
<cfoutput query="queryCars" maxrows="4">
<div class="Result">
<img src="images/samplecar.png" />
<div class="ResultText">
#strYear# #strMake# #strModel#
</div>
</div>
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
所以它实际上用完全相同的东西取代了一件事.我的呼叫页面在标题中有一个.
ajax调用看起来像是从CF返回HTML.所以基本上,你有2个选择.
<style>标记内生成css 并将其与查询表一起返回..cfm使用相同的预定义类.| 归档时间: |
|
| 查看次数: |
49 次 |
| 最近记录: |