Quote:
Originally Posted by Easy5s.net
1) How to put {vb:rawphrase xxx} in file xxx.js
|
If you look at the headinclude template, you can see where a number of js variables are defined using template variable. You can create one of your own using a phrase, then use the variable in xxx.js (assuming it's included after the headinclude code). You could use the headinclude_javascript template hook to include your code, and maybe create a plugin using hook parse_templates and code like:
Code:
global $template_hook;
$template_hook['headinclude_javascript'] .= '<script type="text/javascript">
<!--
PHRASE_XXX = "' . addcslashes($vbphrase['xxx'], '"\\') . '";
</script>';
Then use PHRASE_XXX in xxx.js. The phrase has to be a type that's loaded on the page that you're displaying (if it's a phrase you're creating and your not sure, use GLOBAL for the type).
I haven't tried the above code at all so it's possible there are typos or other errors.
I don't know the answer to your second question.