Easily embed with JavaScript

ANON::form > Blog > Contact forms > Easily embed with JavaScript

Although our forms work great standalone, which we recommend for whistleblower forms, there is also the option to embed all of our E2EE forms as iframes in your website using our JavaScript library.

With our JavaScript library, you can easily embed all types of the forms included in your ANON::form subscription by entering a simple shortcode where you enter the URL of the form you want to embed. You can use several different forms/embeddings on the same page. The embed is 100% responsive.

The JavaScript library works with all types of websites and CMS and our customers use it today in systems such as WordPress, Joomla, Wix, Drupal and Sitevision.

Note! We also offer plugins for installation in WordPress and Joomla (you can find them in the add-ons directory of each system). The main difference is where the code is executed; with JavaScript, it’s in the browser, and with plugins, it’s the web server that does the work (which we recommend).

The JavaScript library works in all modern browsers with JavaScript enabled and can be downloaded from this website:

Do this:

  1. Download the JavaScript library to your computer
  2. Unzip the zip archive
  3. Upload the JavaScript file to your website
  4. Include the JavaScript file in the HEAD section of the page(s) where the shortcode is to be used (you can include the JavaScript file in all your pages without using any shortcode in the page)
  5. Use a shortcode as per [anonform link="path to your form"] to embed a form
  6. The embedding is an iframe that you can easily style if you want by adding css to the shortcode according to [anonform link="path to your form" css="full css string"], more info can be found in the JavaScript file

IMPORTANT! Your Content-Security-Policy (CSP) “child-src” HTTP security header settings must allow iframes from the URL you use for your ANON::form. Read the “Content Security Policy (CSP) Quick Reference Guide for more info.

Use a test form to check your installation

ANON::form offers a special test url, “https://test.anonform.com” (CSP child-src must contain https://*.anonform.com), where the configuration can be tested with different forms and languages. The forms in this test mode are fully functional but do not submit anything.

Form options (add to URL):

  • /Fce (embedded contact form, default)
  • /Fcwe (small anonymous embedded whistleblower form)
  • /Fcwxe (large embedded whistleblower form)

Languages alternatives, (add to URL):

  • /Lar (عربى)
  • /Lda (Dansk)
  • /Len (English)
  • /Lfi (Suomeksi)
  • /Lde (Deutsch)
  • /Lno (Norsk)
  • /Lpl (Polskie)
  • /Lpt (Português)
  • /Lro (Română)
  • /Lru (Русский)
  • /Les (Español)
  • /Lsv (Svenska)
  • /Lth (ไทย)
  • /Luk (Український)
  • /Lsq (Shqiptare)
  • /Lfr (Français)
  • /Lel (Ελληνικά)
  • /Lit (Italiano)
  • /Llt (Lietuvių)
  • /Ltr (Türkçe)
  • /Lbg (български)
  • /Lbs (Bosanski)
  • /Lhr (Hrvatski)
  • /Llv (Latviski)
  • /Lsr (Српски)
  • /Lnl (Nederlands)
  • /Lsw (Kiswahili)
  • /Let (Eesti keel)
  • /Lfa (فارسی اصلاح شده)

Example test url with contact form in English:
https://test.anonform.com/Fce/Len