Sei sulla pagina 1di 2

Using the Information Service for Parents Sign-up widget

The NHS Information Service for Parents Sign-up widget allows you to embed a sign-up form for the Service directly onto your website. This gives mums or dads the option to sign up for email newsletters directly from the page theyre viewing on your site.

How to add the widget to your site


We use the popular jQuery JavaScript library to provide an easy mechanism to embed the widget onto pages on your site following a simple, three-step process 1. First, paste the following links into your page:
<script type="text/javascript" src="http://media.nhschoices.nhs.uk/isfp/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="http://media.nhschoices.nhs.uk/isfp/jquery-ui1.8.18.custom.min.js"></script> <script type="text/javascript" src="http://media.nhschoices.nhs.uk/isfp/nhs-isp-signup.js"></script> <link rel='stylesheet' type='text/css' href="http://media.nhschoices.nhs.uk/isfp/nhs-isp-signup.css"/>

2. Next, add a <div> tag on the page youd like the widget to appear on and give it a unique id. For instance: <div id="isp-signup-widget"></div> 3. Finally, add the following script snippet to your page: <script type="text/javascript"> $(function () { $('#isp-signup-widget').nhsISPSignupWidget(); }); </script> If you have any problems, or have a question about embedding the widget onto your site, contact the Information Service for Parents helpdesk. email: support@informationserviceforparents.nhs.uk tel: 0845 458 0159

FAQs
Can I put more than one widget on a web page? No - the widget can only be deployed to a single page at any one time. I already use a .css file on my web page; will this cause an issue? No: if you already use style sheets on your pages, the use of an additional.css file will not cause conflict because the identifiers we use within the file are unique (see http://www.basictips.com/using-multiple-external-style-sheets.shtml). The widget causes a new tab to be loaded in the users browser; is this correct behaviour? Yes: we dont want to take the user away from your site, and we also need to validate some of the information that the user provides to us. Rather than provide a complex form on your website to capture all of this information, we took the view that temporarily displaying the full form was a better approach for both of us. Can I use this widget on any web page? Yes. The widget uses JavaScript to collect and process the information entered, so it can be safely used on virtually any page where the user has JavaScript enabled in their browser. We provide both minified and uncompressed versions of the JavaScript so that the widget loads as quickly as possible. My site already uses jQuery. Can I use the widget with other versions of the library? Yes, provided that the version that you use is 1.3 or later. We have tested the sign-up widget with jQuery versions 1.3 1.7 to make sure that it works with the most popular versions. If you do encounter errors, you might want to consider running the widget with the jQuery no conflict option, like this: <script type="text/javascript"> $.noConflict(); jQuery(document).ready(function ($) { $('#nhs-isp-signup).nhsISPSignupWidget(); }); </script> What if I need help embedding the widget? For assistance embedding the widget, contact the Information Service for Parents helpdesk. email: support@informationserviceforparents.nhs.uk tel: 0845 458 0159

Potrebbero piacerti anche