当我将数组打印到控制台时,我得到以下符号:“
使用以下代码:
<br>↵
”。如何在JS数组中用逗号替换所有“<br>↵
”的实例?例如:["767 5th Ave<br>↵New York, NY 10153, USA", "677 5th Ave<br>↵New York, NY 10022, USA"]
为了
["767 5th Ave, New York, NY 10153, USA", "677 5th Ave, New York, NY 10022, USA"]
该值来自于:
<address class="main">
<p>767 5th Ave<br>
New York, NY 10153, USA</p>
</address>
使用以下代码:
$("address.main p:not(:empty)").each(function() {
addresses_google[0].push( $(this).html() );
});