[solved] Custom field plugin - How to get parameter values in javascript

Started by gba, February 09, 2015, 15:28:58 PM

Previous topic - Next topic

gba

Hello All!

Within PHP I can get parameter values of a custom field plugin this way:
$plugin = &JPluginHelper::getPlugin('vmcustom', 'myplugin');
$pluginparams = new JRegistry($plugin->params);
$paramvalue = $pluginparams->get('myparameter');


But How can I get the parametervalue in a JS file?
Thank you very much for your help in advance!

Kind regards,
Gerald

GJC Web Design

not on the fly but in your JS

<?php
$plugin = &JPluginHelper::getPlugin('vmcustom', 'myplugin');
$pluginparams = new JRegistry($plugin->params);
$paramvalue = $pluginparams->get('myparameter');
?>

<script type="text/javascript">
   jQuery(document).ready(function($){
      var nelly = '<?php echo $paramvalue; ?>';

          // do something
   });
   jQuery.noConflict();
</script>
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

gba