別のページからリンクのリストを取得して配列にプッシュする関数を作成しようとしていますが、成功関数の後に何をすべきかについて行き詰まっています。
$('#button').click(function() {
var array = [];
$.get('links.html',function(data) {
//here's where I'm stuck
$('#photo a').each(function(){
array.push($(this).attr('href'));
});
});
links.html
<html>
<body>
<div id="photo">
<a href="link1.html">...
<a href="link2.html">...
ありがとう!