Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6071487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:03:10+00:00 2026-05-23T10:03:10+00:00

I am creating a website that’s being localized through JavaScript, however… I have alot

  • 0

I am creating a website that’s being localized through JavaScript, however… I have alot of pages and in each page there are alot of text inputs items, I am using this plugin

http://code.google.com/p/jquery-watermark/

to apply watermark on my inputs, now I just need guides for better performance.

  1. Shall all watermarks be in one javascript file, or each page shall have it’s own watermarks in it’s own javascript file?

  2. Shall i create one JavaScript file having all the system $(object).watermark() (I am choosing objects by classes), or each page with it’s own JavaScript file must contain the jQuery watermark line of code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:03:10+00:00Added an answer on May 23, 2026 at 10:03 am

    General: normally you would have page specific things in a page specific javascript.

    Your Problem;
    assuming your html looks something like this;

    <input type='text' name='bla'></input>
    

    You could rewrite it to read;

    <input type='text' name='email' class='watermark' data-watertype='email'></input>
    

    You could apply a single javascript snippet and inlcude it throughout the page;

        var texts={ "email":"Please enter a valid email address", .... },
            elems=jQuery("input.watermark"),
            elem,
            watermarkType;
    
        elems.each(function(i,elem){
            elem=jQuery(elem);
            watermarkType = texts[ elem.attr("data-watertype") ] || "";
            if (watermarkType.length!==0){
                //apply the watermark
                elem.watermark(watermarkType);
            }
        }
    //this isn't tested but should work as expected!
    

    thus resolving the need of having a specific javascript for each page to apply the watermarks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a website that has 5 different sub-sites each with the same
I'm creating an installer for a website that uses a custom event log source.
Are there any good books or website that go over creating a JTable ?
I have been creating a website with Ruby on Rails, and will be hosting
I'm creating a user-based website. For each user, I'll need a few MySQL tables
I am creating a website for a University assignment and we have to concentrate
I am creating a new website that needs to work in desktop browsers as
I am currently creating a website in php that has a database backend (can
I read from sun website that for every reference jvm is creating one immutable
I am creating a website in CakePHP and I am kind of new on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.