动态jQuery内容未显示在Mobile with HTML5上

时间:2016-01-02 23:55:19

标签: jquery ajax html5 coldfusion

我有一个HTML5模板,我用动态jQuery / ajax生成的内容替换静态内容。内容在Chrome等桌面浏览器上显示得很好。当我尝试在iPhone或iPad等移动设备上查看内容时,动态生成的内容不会显示。我将发布静态内容和动态内容。

静态内容



					<div class="col-lg-6 wow fadeInLeft">
                        <article class="row row-no-gutter blog-post">
                            <div class="col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image"
                                 style="background-image: url('images/page-1_img09.jpg')" data-equal-group="1">
                            </div>
                            <div class="col-xs-12 col-sm-6 text-md-left" data-equal-group="1">
                            
                                <div class="blog-post__cnt">
                                	
                                    <h5>some text</h5>
                                    <hr class="sm sm--inset-2 sm-default"/>
                                    
                                    <p>some text</p>

                                    <p>some text</p>
                                    <a href="#" class="btn-link">READ MORE</a>
                                </div>
                            </div>
                        </article>
                    </div>
                    <div class="col-lg-6 wow fadeInRight">
                        <article class="row row-no-gutter blog-post">
                            <div class="col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-sm-right pull-lg-left"
                                 style="background-image: url('images/page-1_img10.jpg')" data-equal-group="1"></div>
                            <div class="col-xs-12 col-sm-6 text-md-left" data-equal-group="1">
                            
                                <div class="blog-post__cnt">
                                    <h5>some text</h5>
                                    <hr class="sm sm--inset-2 sm-default"/>
                                    
                                    <p>some text</p>
                                    <a href="#" class="btn-link">READ MORE</a>
                                </div>
                            </div>
                        </article>
                    </div>
                    <div class="col-lg-6 wow fadeInLeft">
                        <article class="row row-no-gutter blog-post">
                            <div class="col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-lg-right"
                                 style="background-image: url('images/page-1_img11.jpg')" data-equal-group="2"></div>
                            <div class="col-xs-12 col-sm-6 text-md-left" data-equal-group="2">
                            
                                <div class="blog-post__cnt">
                                    <h5>some text</h5>
                                    <hr class="sm sm--inset-2 sm-default"/>
                                    
                                    <p>some text</p>
                                    <a href="#" class="btn-link">READ MORE</a>
                                </div>
                            </div>
                        </article>
                    </div>
                    <div class="col-lg-6 wow fadeInRight">
                        <article class="row row-no-gutter blog-post">
                            <div class="col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-sm-right"
                                 style="background-image: url('images/page-1_img12.jpg')" data-equal-group="2"></div>
                            <div class="col-xs-12 col-sm-6 text-md-left" data-equal-group="2">
                                <div class="blog-post__cnt">
                                    <h5>some text</h5>
                                    <hr class="sm sm--inset-2 sm-default"/>
                                    
                                    <p>some text</p>
                                    <a href="#" class="btn-link">READ MORE</a>
                                </div>
                            </div>
                        </article>
                    </div>
&#13;
&#13;
&#13;

动态内容

&#13;
&#13;
 <script type="text/javascript">
		var html = "";
	
		function assetsPost() {
		$.ajax({
			  cache: false,
			  type:'GET',
			  url:'cfc/cfc_Forum.cfc?method=getMessages&returnformat=json',
			  dataType: "json",
			  data: {
				  maxRows:  4,
				  origin: 1,
				},
			  success:function(data) {
				if(data) {   // DO SOMETHING 
				jQuery.each(data, function(i, val) {    
					 $('#messages').html(data[i].annotation);
					 var threadID   = data[i].thread;
					 var BodyText   = data[i].body;
					 var name		= data[i].name;
					 var MessageID	= data[i].MessageID;
					 var photo		= data[i].photo;
					 var annotation = data[i].annotation;
					  	if(i == 0) {
					  	html += "<div class='col-lg-6 wow fadeInLeft'>";
					  	html += "<article class='row row-no-gutter blog-post'>";
						html += "<div class='col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image' style='background-image: url(" + photo + ")' data-equal-group='1'></div>";
						html += "<div class='col-xs-12 col-sm-6 text-md-left' data-equal-group='1'>";
						}
						else if(i == 1) {
						html += "<div class='col-lg-6 wow fadeInRight'>";
					  	html += "<article class='row row-no-gutter blog-post'>";
						html += "<div class='col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-sm-right pull-lg-left' style='background-image: url(" + photo + ")' data-equal-group='1'></div>";
						html += "<div class='col-xs-12 col-sm-6 text-md-left' data-equal-group='1'>";
						}
						else if(i == 2){
						html += "<div class='col-lg-6 wow fadeInLeft'>";
					  	html += "<article class='row row-no-gutter blog-post'>";
						html += "<div class='col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-lg-right' style='background-image: url(" + photo + ")' data-equal-group='1'></div>";
						html += "<div class='col-xs-12 col-sm-6 text-md-left' data-equal-group='2'>";
						}
						else if(i == 3){
						html += "<div class='col-lg-6 wow fadeInRight'>";
					  	html += "<article class='row row-no-gutter blog-post'>";
						html += "<div class='col-xs-8 col-xs-offset-2 col-sm-offset-0 col-sm-6 bg-image pull-sm-right' style='background-image: url(" + photo + ")' data-equal-group='1'></div>";
						html += "<div class='col-xs-12 col-sm-6 text-md-left' data-equal-group='2'>";
						}
					  html += "<div class='blog-post__cnt'>";
						
						html += "<h5>" + name + "</h5>"
						html += "<hr class='sm sm--inset-2 sm-default'/>";
						html += "<p>" + BodyText.substr(0, 400) + "</p>";
						html += "<a href='#' class='btn-link'>READ MORE</a>";			 
						 
					   html += "</div>";
					   html += "</div>";
					   html += "</article>";
					   html += "</div>";
				});
					 $('#qMessage').html( html );
				} else { // DO SOMETHING 
			  }
			}
		});
	}  
	assetsPost();  
	</script>
&#13;
&#13;
&#13;

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

找到我自己的问题。这是coldfusion用户身份验证的问题。