Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用jquery返回css格式的coldfusion结果_Jquery_Css_Coldfusion - Fatal编程技术网

使用jquery返回css格式的coldfusion结果

使用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

好的,我做了这个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);
    }
  });
}
编辑-这是获取新内容的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,并将其与查询表一起返回
  • 在调用者页面中包含css文件,并确保从
    .cfm
    生成的结果使用相同的预定义类

  • ajax调用看起来像是从CF返回HTML。因此,基本上,您有两个选项

  • 标记中生成css,并将其与查询表一起返回
  • 在调用者页面中包含css文件,并确保从
    .cfm
    生成的结果使用相同的预定义类

  • 这就是让人困惑的地方——调用它的页面正在用新的查询结果替换一个div——放置在div中的项具有所有相同的类。我按照您的建议包括了样式标记。很好。这就是令人困惑的地方——调用它的页面正在用新的查询结果替换一个div——放在div中的项具有所有相同的类。我按照您的建议包括了样式标记。效果很好。