我正在使用 Picasa Web Integrator (PWI) 代码,它允许我使用 picasa 帐户展示图片库。用户使用表单编写关键字,然后代码创建一个 div 并调用 PWI。
它工作得很好,但我正在尝试添加一个“后退”按钮,以便让用户选择不同的关键字而无需刷新。
但是代码似乎没有清除内存,结果和第一次一样。
这是代码:
//The button that the user presses when he has written the keyword.
$("#boton2").click(function() {
//Creates a new div
$(".shop3").append("<div></div>");
$('.shop3 > div').attr('id', 'container3');
//gets the keyword and creates a variable called "competidor"
competidor = $('#competidor_txt').val();
//calls for the PWI code...
$("#container3").pwi({
username: 'davidagnino',
mode: 'keyword',
...
//This part works perfectly.
//The "back" button that should delete the div called #container3
$('#back3').click(function() {
event.preventDefault();
competidor=null;
delete competidor;
$("#container3").empty(); //should make my div empty
$("#container3").remove(); //deletes the div...
});