这是的script.js 我jQuery的功能,此功能使用来从闪烁的进料和填充结构。如何将html元素填充到另一个页面中?
我想填充HTML结构到另一个名为html页面“items.html”
$function getImages(){
$.getJSON("http://api.flickr.com/services/feeds/[email protected]&lang=en-us&format=json&jsoncallback=?", displayImages);
function displayImages(data) {
// Start putting together the HTML string
var htmlString = '';
// Now start cycling through our array of Flickr photo details
$.each(data.items, function(i,item){
// Here's where we piece together the HTML
htmlString += '<div class="item_wrapper" name="'+item.title+'">';
htmlString += '<img class="item_picture" src="' + item.media.m + '" alt=""/>';
htmlString += '<div class="item_data">';
htmlString += '<div class="item_company">';
htmlString += '<h3 class="fi se en">'+item.title+'</h3>';
htmlString += '</div>';
htmlString += '<div class="item_title">';
htmlString += '<h3 class="fi">'+item.title+'</h3>';
htmlString += '<h3 class="se">'+item.title+'</h3>';
htmlString += '<h3 class="en">'+item.title+'</h3>';
htmlString += '</div>';
htmlString += '</div>';
htmlString += '</div>';
});
// Pop our HTML in the DIV tag of items.html
// Here's the problem.
$('div').html(htmlString);
}
}
所以,我该怎么办呢? 谢谢!
如果您仍然需要使用您的问题,您应该添加更多的信息到您的文章帮助;主要是,你正在努力为你的用户提供哪些功能。你所问的技术问题是好的,但由于你对HTML和jQuery的经验是新手(你的话:P),你很有可能以其他方式达到你想要完成的目标。 – rkw