资 源 简 介
JQuery Messages Plugin
A plugin for JQuery to manage labels in applications.
Description
Loads the labels for your application and re-use they when are needed:
var labels = { greetings : "Hello world!!!", greetingsTo : "Hello {name}"}$.loadMessages(labels);
The labels can be tokenized and replaced when are required with the correct values:
alert($.message("greetings")); // --> Hello world!!!alert($.message({key : "greetingsTo", params: {name: "Manuel"}}); // --> Hello Manuel
or you can change directly the content of a tag:
$("h1").message({key : "greetingsTo", params: {name: "Manuel"}}); //Change the content of all "h1" to "Hello Manuel"
There is the possibility of use the element"s id as key of the message: