I want to make some thing like this
my-php-file.php
$lang = 'es';
my-js-file.js
if ($lang == es)
{
something-magical-happens;
}
or like this:
if (URL == www.mydomain.com/index.php?lang=es)
{
something-magical-happens;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
you could generate js on-the-fly
my.js.php:
Now, try to include
in your html and you’ll see 🙂
Edit: Check it in action here: http://h.kissyour.net/so/phpjs/
Edit: Edited example on my server to closer resemble what I wrote here.
Edit: Oh yes. Don’t forget to clean your code!