我有这个在 Chrome 和 Firefox 中运行良好的功能,但由于某种原因,它在 IE 中根本不起作用。
错误消息是'无法获取未定义或空引用的属性'标题''
我相信它没有注册结果,但不知道为什么这只是 IE 的问题。
function create_the_list_item(r){
            var title = $('<h3 />',{'class':'title'}).html('<span class="icon-location location">'+r.title+(r.miles?(' <span style="font-size:75%">('+r.miles+' miles away)</span> '):'' )+' </span>')
            var add = $('<div />',{'class':'address left'}).html(
                '<p>'+(r.address_line_1+'<br/> ' ) + 
                (r.address_line_2?(r.address_line_2+'<br/> '):'' ) +
                (r.county?(r.county + '<br/> '):'') +
                (r.country?r.country + '<br/> ' :'') +
                (r.post_code?r.post_code :'')+'</p>'
            );
            var website = $('<div />',{'class':'right'}).html(
                (r.website?('<a href="http://'+r.website.replace('http://','')+'" target="_blank">Visit Website</a><br/><br/>' ):'')+
                (r.website?(r.telephone_number ):'')
            )
            return ($('<div />',{'class': 'the_shop_list clearfix'})
                .data('longitude',r.longitude)
                .data('latitude',r.latitude)
                .data('title',r.title)
                .data('tel',r.telephone_number)
                .data('website',r.website)
                .append(title).append(add).append(website)
                )
        }