Passing data from PHP to JavaScript · A Beautiful Site

Source: Passing data from PHP to JavaScript · A Beautiful Site

 

Ever needed to send a PHP variable, array, or object to JavaScript? It can get complicated trying to escape the output properly. Here’s a way that always works—no escaping necessary.

Passing data from PHP to JavaScript

Have you ever needed to send a PHP variable, array, or object to JavaScript? It can get complicated trying to escape the output properly. Here’s a way that always works—no escaping necessary.

Let’s say we have the following variable in PHP:

  • $name = ‘Bob Marley’;

And we want to pass it to a JavaScript variable called name. Here’s the trick:

  • echo ‘<script>’;
  • echo ‘var name = ‘ . json_encode($name) . ‘;’;
  • echo ‘</script>’;

Using json_encode(), you’ll always get a properly formatted JavaScript object.

So Your Client Wants a WordPress Slider? Here’s What You Need to Know

Whether you love them or hate them, sliders are still a popular feature of many free and premium themes. It’s not too difficult to see why: they’re eye-catching and draw attention to key information on your site. Despite the pros, there are many cons to using sliders. Here’s our verdict on whether you should use sliders or not.

Source: So Your Client Wants a WordPress Slider? Before You Cringe, Here’s What You Need to Know

Old-skool slider - not responsive, not accessible...
Old-skool slider – not responsive, not accessible…

We love a slider so we don’t think they’re going to disappear so soon.

New Features in CiviCRM

The creators of open-source CRM software CiviCRM have released details of the new features coming in the next release of the free software.

2020Media is a leading UK web hosting provider of CiviCRM – details about our hosting service can be found at http://www.2020media.com/shared-hosting/civcrm-hosting

CiviCRM 4.7 Planned Features

  • Form Builder – First phase implementation of a new forms framework which will be designed to allow for easy customization of core forms.
  • Administrator Status Page – Provide CiviCRM site administrators with a single place to check for configuration problems including cron status, file permissions, MySQL permissions, invalid or sub-optimal PHP settings, etc. These statuses can also be queried via API to allow for automated status checks.
  • Administer Settings improvements – Provides a unified and searchable administrative interface for all configurable settings. Makes it easier for extensions to add settings to this interface.
  • Installer improvements – Streamlined install process for WordPress sites. Initialize newly installed sites with localization settings (language, currency, etc.) based on the users locale. 2020Media provide pre-installed CiviCRM so we’ll take care of this for you!
  • Payment processing improvements
  • Webform CiviCase integration enhancements (sponsored by Compucorp Ltd.) – Add case roles to a case in webforms and allow users to specify a case when creating an activity.
  • CiviMail Inline (pending code contribution from Veda Consulting) – Improves usability when composing and editing mailings based on templates by allowing the designer to create editable and non-editable regions.
  • Offline recurring payments (pending code contribution from Veda Consulting and API from JMA Consulting) – Manage recurring contributions that are initiated outside of CiviCRM.  Ensures that these Direct Debit or Standing Order payments are allocated to the correct contacts, and that the recurring details are fully accessible to CRM administrators.
  • Navigation / Menu Improvements (pending collaboration with Compucorp Ltd.) – Modernize the main navigation menu, provide vertical side-bar display options, include icons.

The target date for a stable release is Early October 2015.