Reputation: 730
I have one question. I do not know if it is possible to do this way but maybe some one can help. Imagine you have 2 definitions php files, where languages are defined. I want to change those files with click on flag.
The aim of this is that i dont want to refresh page so i want to do it with jquery. Second thing is that my whole structure is that i only load files to div named contentwrapper. I was wondering about creating copy of each file in another language and with click i will empty every wrapper and load files with another languages.
I hope someone will understand what i want to do.
I wanted to load this definition file with 'flagclick' but this dont work. Its 100% that server will not reload definitions with jquery via load. Or maybe there is still that old definitions default file.
Can someone give me some hints?
Thanks!
Upvotes: 0
Views: 136
Reputation: 923
See if this could help:
Bind a js function to your 'flagclick', which would send an Ajax call to the corresponding php file, like 'lang-en.php', 'lang-other.php'... to load all the context as Json object. And use the values from the Json data to replace all the text displayed.
Upvotes: 2