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! Sitali Chrispin Simasiku -- Charles Lwanga College of Education, P. O. Box 660193, Monze, ZAMBIA. Mobile: +26 0979 869471 +26 0966 869471 SKYPE: Libsitali
* 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"); });
Hi Crispin You should only ever have one $document.ready so you can put this together as one block $(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:"); var holdlinks = $("a:contains('Place Hold'),a:contains('Place hold')"); $(holdlinks).text("Get It Now!"); $("a:contains('Browse Shelf')").text("See Similar Items"); }); $(window).load(function(){ $("input[value='Place Hold']").attr("value","Get It Now!"); Chris -- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand
Thanks you very much Chris for coming to my aid. I really appreciate On 11 August 2014 10:51, Chris Cormack <chrisc@catalyst.net.nz> wrote:
* 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"); });
Hi Crispin
You should only ever have one $document.ready so you can put this together as one block
$(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:"); var holdlinks = $("a:contains('Place Hold'),a:contains('Place hold')"); $(holdlinks).text("Get It Now!"); $("a:contains('Browse Shelf')").text("See Similar Items"); });
$(window).load(function(){ $("input[value='Place Hold']").attr("value","Get It Now!");
Chris
-- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand
-- Charles Lwanga College of Education, P. O. Box 660193, Monze, ZAMBIA. Mobile: +26 0979 869471 +26 0966 869471 SKYPE: Libsitali
You are on the right track Chrispin ;) Do not put the $(document).ready and this should work. Can you try the following : $("#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!"); $("input[value='Place Hold']").attr("value","Get It Now!"); $("a:contains('Browse Shelf')").text("See Similar Items"); Hope that helps, Eric On 2014-08-10 04:07, Chrispin Simasiku Sitali 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!
Sitali Chrispin Simasiku
On 2014-08-10, at 8:07 PM, Chrispin Simasiku Sitali 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!");
}); }); hi, you missed 2 lines?
Hello Chrispin, How are you doing?
On Aug 10, 2014, at 4:07 AM, Chrispin Simasiku Sitali <libsitali@gmail.com> wrote:
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!"); });
Basically the syntax would be like $(document).ready(function(){ <multiple statements go here> }); So you only need the first and last line only once. Hope this helps. Olugbenga Adara Sent from a mobile device. Please excuse typos and brevity.
Hi Chrispin, Like so: $(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:"); 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!"); $("a:contains('Browse Shelf')").text("See Similar Items"); }); You only need one $(document).ready(function(){ }); around all of your other statements that start with $, as above. Cheers, Liz Rea Catalyst IT NZ On 10/08/14 20:07, Chrispin Simasiku Sitali 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!
Sitali Chrispin Simasiku
-- -- Liz Rea Catalyst.Net Limited Level 6, Catalyst House, 150 Willis Street, Wellington. P.O Box 11053, Manners Street, Wellington 6142 GPG: B149 A443 6B01 7386 C2C7 F481 B6c2 A49D 3726 38B7
You can just write all statements in opacuserjs, no problem. Yet it is better to have only one $(document).ready() call to manage the oder of execution. Best regards, Le 10/08/2014 10:07, Chrispin Simasiku Sitali a écrit :
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!
Sitali Chrispin Simasiku
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
participants (7)
-
Chris Cormack -
Chrispin Simasiku Sitali -
Eric Bégin -
Fridolin SOMERS -
Liz Rea -
Mason James -
Olu Adara