Skip to content

Commit 2e94a2b

Browse files
committed
Replace obsolete $(document).ready(...) syntax.
According to https://api.jquery.com/ready, the following should be used instead: ``` $(function() {... }) ```
1 parent 441e1ce commit 2e94a2b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/htmlgen.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static QCString substituteHtmlKeywords(const QCString &str,
431431
{
432432
searchCssJs += "<script type=\"text/javascript\">\n"
433433
"/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */\n"
434-
" $(document).ready(function() { init_search(); });\n"
434+
" $(function() { init_search(); });\n"
435435
"/* @license-end */\n"
436436
"</script>";
437437
}
@@ -442,7 +442,7 @@ static QCString substituteHtmlKeywords(const QCString &str,
442442
{
443443
searchCssJs += "<script type=\"text/javascript\">\n"
444444
"/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */\n"
445-
" $(document).ready(function() {\n"
445+
" $(function() {\n"
446446
" if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n"
447447
" });\n"
448448
" /* @license-end */\n"
@@ -2839,11 +2839,11 @@ static void writeDefaultQuickLinks(TextStream &t,bool compact,
28392839
{
28402840
if (!serverBasedSearch)
28412841
{
2842-
t << " $(document).ready(function() { init_search(); });\n";
2842+
t << " $(function() { init_search(); });\n";
28432843
}
28442844
else
28452845
{
2846-
t << " $(document).ready(function() {\n"
2846+
t << " $(function() {\n"
28472847
<< " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n";
28482848
t << " });\n";
28492849
}
@@ -2885,7 +2885,7 @@ static void writeDefaultQuickLinks(TextStream &t,bool compact,
28852885
{
28862886
t << "<script type=\"text/javascript\">\n";
28872887
t << "/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */\n";
2888-
t << "$(document).ready(function() { init_codefold(" << (relPath.isEmpty() ? "0" : "1") << "); });\n";
2888+
t << "$(function() { init_codefold(" << (relPath.isEmpty() ? "0" : "1") << "); });\n";
28892889
t << "/* @license-end */\n";
28902890
t << "</script>\n";
28912891
}
@@ -2922,7 +2922,7 @@ QCString HtmlGenerator::writeSplitBarAsString(const QCString &name,const QCStrin
29222922
"</div>\n"
29232923
"<script type=\"text/javascript\">\n"
29242924
"/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */\n"
2925-
"$(document).ready(function(){initNavTree('") + fn +
2925+
"$(function(){initNavTree('") + fn +
29262926
QCString("','") + relpath +
29272927
QCString("'); initResizable(); });\n"
29282928
"/* @license-end */\n"
@@ -3153,7 +3153,7 @@ void HtmlGenerator::writeExternalSearchPage()
31533153
t << "};\n\n";
31543154
t << ResourceMgr::instance().getAsString("extsearch.js");
31553155
t << "\n";
3156-
t << "$(document).ready(function() {\n";
3156+
t << "$(function() {\n";
31573157
t << " var query = trim(getURLParameter('query'));\n";
31583158
t << " if (query) {\n";
31593159
t << " searchFor(query,0,20);\n";

0 commit comments

Comments
 (0)