Check out the latest documentation.

Passing Properties To Client Side

An optional include script can be added to the web page to provide information to client side javascript concerning the device enabling decisions to be taken in javascript. The javascript returned will create an object called FODF (51Degrees Features) which can be used to request properties. For example: the following JavaScript would return the IsMobile value:

										
										if
										
									 (FODF.IsMobile) {
  
										
										// Do something for mobiles only.
										
									
}

									

The value returned will be of a type associated with the property. See the Property Dictionary for details of property types.

Adding to a Web Page

The necessary javascript includes need to be added into the page. The following needs to be added to the HTML page header before accessing the FODF variable:

										
										<script 
										
										
										src=
										
										
										"/51Degrees.features.js"
										
										
										type=
										
										
										"text/javascript"
										
										
										></script>