我在使用javascript中的函数时遇到问题,无法弄清楚原因.这真的很直接.我正在尝试删除html表中的所有行.所以我写道:
function delete_gameboard(){
var table = document.getElementById("gameboard");
var rowCount = table.rows.length;
for (var i = 0; i < rowCount; i++) {
table.deleteRow(i);
}
}
Run Code Online (Sandbox Code Playgroud)
然而,它只会删除其中的一半.任何人都能看到导致这种奇怪行为的原因吗?
我已在 AWS Elastic Beanstalk 上设置了我的应用程序。我添加了一个负载均衡器,并将“www”的 CNAME 指向它。但现在我也需要把根指向那里。我无法使用 Route53 并使用 AWS 名称服务器,因为客户端想要使用他们的名称服务器。我怎样才能获得我的应用程序的root权限?我可以重定向流量吗?与我合作的技术主管建议设置服务器来进行重定向?
我不断得到这个我无法弄清楚的错误:
Failure/Error: get :find_movies, {:id => @id_passed }
NoMethodError:
undefined method `get' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x0000000363f800>
Run Code Online (Sandbox Code Playgroud)
对于以下rspec测试:
it 'should find the movie in the database by the passed id' do
Movie.should_receive(:find).with(@id_passed).and_return(@movie_found)
get :find_movies, {:id => @id_passed }
end
Run Code Online (Sandbox Code Playgroud)
它使用以下路线:
get '/movies/find/:id' => 'movies#find', :as => :find_movies
Run Code Online (Sandbox Code Playgroud)
我的控制器包括:
def find
@movie = Movie.find params[:id]
if @movie.director != ""
@similar = Movie.where({:director => @movie.director}).all if @movie.director
else
flash[:warning] = "\'#{@movie.title}\' has no director info"
redirect_to movies_path
end
end
Run Code Online (Sandbox Code Playgroud)
我的朋友几乎写了完全相同的代码,并使其工作.任何人都可以帮我弄清楚为什么这不起作用?非常感谢!