我的HTML页面的一部分如下div:
<div id="images_wrapper">
<img ... />
<img ... />
<img ... />
...
</div>
Run Code Online (Sandbox Code Playgroud)
最初,这div是隐藏的,我只在加载所有图像时显示它:
$(window).load(show_images_wrapper);
Run Code Online (Sandbox Code Playgroud)
但是,如果我没有弄错,show_images_wrapper只有在加载所有页面时才会调用.我想show_images_wrapper在内部所有图像images_wrapper加载后立即调用,并且不要等到所有页面都加载完毕.
我试过了:
$("#images_wrapper").load(show_images_wrapper);
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
我该怎么做?
我试图像这样扩展ruby字符串类:
String.class_eval do
def clear!
# Here I want the string value to be set to empty string. The following code is not working.
self = ''
end
end
Run Code Online (Sandbox Code Playgroud) 我是通过铁路发送邮件的新手.我在项目实施的装置和后现在我想发送欢迎电子邮件和/或密码重置邮件.我需要在Devise视图中做出哪些更改?没有显示错误,但我仍然没有收到任何电子邮件.
我已经按照这些链接,最后我的devise.rb,development.rb和production.rb文件如下:
=== devise.rb ===
config.mailer_sender = "xxx@gmail.com"
Run Code Online (Sandbox Code Playgroud)
=== development.rb ==
config.action_mailer.raise_delivery_errors = false
config.action_dispatch.best_standards_support = :builtin
config.active_support.deprecation = :notify
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.active_support.deprecation = :log
config.action_mailer.smtp_settings ={
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:tls => true,
:domain => 'gmail.com',
:authentication => :plain,
:user_name => 'xxx@gmail.com',
:password => 'xxxxxx'
}
=====production.rb===
config.action_mailer.default_url_options = { :host => 'gmail.com' }
config.active_support.deprecation = …Run Code Online (Sandbox Code Playgroud)