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

  • SEARCH
  • Home
  • 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 852439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:35:42+00:00 2026-05-15T07:35:42+00:00

Good morning! I’m having great success so far with CodeIgniter. I’m new to PHP

  • 0

Good morning!

I’m having great success so far with CodeIgniter. I’m new to PHP and web development in general, but I feel that CodeIgniter is giving me a leg up while I catch up on the basics.

My question for today is this – I have been happily loading config and lang values from my views for a while now, and everything is working fine. But what about JavaScript files being linked into my views? Is there any way to make the $this->lang->line and $this->config->item function references available to me in my JavaScript files?

I am implementing jQuery client-side validation, and would like to pull in my error messages from the server, both to support internationalisation and to make sure that validation gracefully degrades if JavaScript is not available, in that the error messages pushed back into the view from the server-side validation are identical to those displayed dynamically by the jQuery validation. I would not like to have to keep coming back to make sure that these strings are kept in sync. As for internationalisation, I’m fresh out of ideas on how to support that if it turns out that lang and config item strings are completely unavailable from my JS files.

Any help you can provide would be greatly appreciated! 🙂

  • 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-15T07:35:43+00:00Added an answer on May 15, 2026 at 7:35 am

    You probably shouldn’t pollute your Javascript files with stuff that requires that they be evaluated on the server, because that is going to make them ineligible for caching. Instead, perhaps you can have part of your pages contain a small script block where some configuration values are stored (as Javascript globals). Then your standalone .js file can just look for that information on the page.

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

Sidebar

Related Questions

good morning, I have created a new content type - petition, a last step
Good morning, I am about to start writing an Excel add-in for Excel 2002.
Good morning. I have an XML file which contains lists of warning and errors
Good morning, I am the developer of a medium sized PDA application that will
Good morning, I work in a small shop (only two of us) and we
Good morning, I am working on a C# winform application that is using validation
Good morning, Apologies for the newbie question. I'm just getting started with ASP.NET internationalization
Good morning, afternoon, evening or night (depending on your timezone). This is just a
Good morning, I am currently writing a python library. At the moment, modules and
Good morning. As the title indicates, I've got some questions about using python for

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.