jquery - Is there any way to access codeigniter language and config properties from included javascript files? -
Good morning!
I have had a great success with CodeIgniter so far. I'm new to PHP and Web development in general, but I think the code igniter is giving me a leg up while I'm basically I get the information.
My question for today is this - I'm happily loading Config and Lang values for a little while with my thoughts, and everything is working fine. But what is being added to my thoughts about javascript files? Is there any way to make my $$ -> lung-> line and $ -> -> my functioning references available in my javascript files?
I am implementing jQuery client-side validation, and want to draw my error messages from the server, both to support internationalization and to ensure that if Javascript is not available, Highly affected by verification, in which the error message is pushed back in view from server-side verification, they are dynamically displayed with jQuery validation . I did not want to come back to make sure that these stars were kept in sync. For internationalization, I am fresh on the idea that if it is found that Lang and Config item string is completely unavailable from my JS files
The help you can provide will be greatly appreciated! :)
You probably should not pollute your javascript files with those that are required for That their evaluation server, because they are going to make them ineligible for caching. Instead, you might create a small script block of your pages, where some configuration values are stored (as JavaScript Globals) then your standalone. The JS file can view that information on the page.
Comments
Post a Comment