Greetings to all, How would I add multiple statements in opacuserjs. e.g. $(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");}); $(document).ready(function(){ var holdlinks = $("a:contains('Place Hold'),a:contains('Place hold')"); $(holdlinks).text("Get It Now!"); }); $(window).load(function(){ $("input[value='Place Hold']").attr("value","Get It Now!"); $(document).ready(function(){ $("a:contains('Browse Shelf')").text("See Similar Items"); }); Please help. Teaching myself all this! -- Charles Lwanga College of Education, P. O. Box 660193, Monze, ZAMBIA. Mobile: +26 0979 869471 +26 0966 869471 SKYPE: Libsitali
On Fri, Aug 8, 2014 at 10:18 AM, Chrispin Simasiku Sitali <libsitali@gmail.com> wrote:
Greetings to all,
How would I add multiple statements in opacuserjs. e.g.
$(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");});
$(document).ready(function(){ var holdlinks = $("a:contains('Place Hold'),a:contains('Place hold')"); $(holdlinks).text("Get It Now!"); }); $(window).load(function(){ $("input[value='Place Hold']").attr("value","Get It Now!");
$(document).ready(function(){ $("a:contains('Browse Shelf')").text("See Similar Items"); });
Please help. Teaching myself all this! -- Charles Lwanga College of Education, P. O. Box 660193, Monze, ZAMBIA.
Mobile: +26 0979 869471 +26 0966 869471 SKYPE: Libsitali _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Web Developer Athens County Public Libraries http://www.myacpl.org
Sorry to have sent an empty reply! Clumsy fingers this morning.
How would I add multiple statements in opacuserjs. e.g.
You can. You can do multiple document.ready() blocks if you want, or combine them: $(document).ready(function(){ // All the events which will run when the page is ready $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:"); var holdlinks = $("a:contains('Place Hold'),a:contains('Place hold')"); $(holdlinks).text("Get It Now!"); $("a:contains('Browse Shelf')").text("See Similar Items"); }); "$(document).ready(function(){" means, "As soon as the page is ready, run these tasks." You can add as many tasks as you want before closing the block with "});" $(window).load(function(){ // This even will run *after* document.ready because "window" waits // for more assets to load completely $("input[value='Place Hold']").attr("value","Get It Now!"); }); I don't think the window.load section necessarily needs to be run separately, but I don't know what situation it was written for. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
participants (2)
-
Chrispin Simasiku Sitali -
Owen Leonard