Digioh Development Framework/API v2.5
Form Submission Data Object: x 10
Interactive Helper Functions 11
Technology and Device Type Functions 17
Visitor Information Functions 18
DataLayer Manipulation Functions 21
Function Reference: boxapi namespace 24
Form Submit Pipeline Functions 27
Dynamic Form Manipulation Functions 29
Digioh allows the dynamic display of popups, forms, and general “calls to action” on your website, and is deployed via a JavaScript tag to your website(s). In technical terms, think of Digioh as a “post-processor” for your website user interface. Typically, the tag activates on each pageview after DOM ready, and then manipulates the HTML to power a variety of marketing use cases. The Digioh portal allows authorized users to control what the Digioh tag does on your site. The main Digioh concepts are:
Boxes: visual objects to display on your site. These can be lightbox, sidebar, or banner “overlays”, or “inlines” that embed into the page. Often but not necessarily, boxes contain forms that when submitted send data to your ESP or CRM via Digioh Integrations. Usually, boxes without forms are intended to redirect users somewhere else on your site.
Integrations: boxes with forms can have one or more configured Integrations that are called on form submission. Typically, this is to add an email address and any other form data to a list in your email platform, but Digioh supports a wide variety of integrations. Form submission data is sent from the browser to the Digioh server using a standard protocol, and the Integration transforms the data and relays it to the configured API endpoint. This also protects any sensitive API credentials since they are stored and used only on the Digioh server.
Box Conditions: these are the logical conditions under which specific boxes are displayed. In simple terms, after each page is loaded Digioh evaluates the conditions for each box and displays it if true. Box Conditions are part of a powerful rules engine used for targeting and personalization.
Custom JS: this is the Digioh development framework and focus of this document. With Digioh, much is possible with just Boxes, Integrations, Conditions, and existing Custom JS Apps, but Custom JS allows developers to customize even further and implement the “last mile” for advanced use-cases. With Custom JS, Digioh can interoperate with existing first or third party JavaScript and data on your site. This can be directly via JavaScript variables and functions, or anything in the DOM, cookies, local storage, or dataLayer, and even the results of API calls.
Additional Documentation is available here: https://help.digioh.com/section/custom-html-js/. Before starting on Custom JS implementation, we recommend you first look for an existing Custom JS App that either solves for your use case or can be modified to do so. View the list of apps from within Digioh, the the profile menu top right, then Custom JS (Apps).
Accessible through the Profile menu in the Digioh portal, there are different types of Custom JS:
Global JS: if you have multiple websites each with a separate Digioh account, Global JS is the common code that runs across all of your site on every pageview. Since your sites likely have a common CMS and code base, Global JS is ideal for implementing custom business logic common to all of your sites.
Page JS: this is a JavaScript snippet that runs once on every pageview. Page JS is ideal for processing data on your page to make it available to Box Conditions. For example, if Boxes should display only to logged in users, Page JS can do the work of detecting this and making a true/false flag available to Box Conditions.
Box JS: this is JavaScript that runs for specific boxes at different points in the box “lifecycle”, such as On Display, On Submit, On Close, etc. Common Box JS use case examples are: custom validation of form input data, tracking to analytics databases, and read/write of cookies, local storage, or JS variables to dynamically interoperate with your page.
In the Box JS editor, you can create an unlimited number of JS snippets for specific boxes.
You can configure the specific event trigger, and a comma separated list of box IDs to include or exclude. The box ID is from the ID column in the main box list page, see below.
An important difference between Page and Box JS is that Page JS runs in the context of the main window object, whereas Box JS runs in an iFrame. This means that if you want to access the main DOM from Box JS, you must reference via the window.parent object as follows:
window.parent.$
window.parent.location
window.parent.document
window.parent.xyz
In Box JS, the window object is the iFrame so if, for example, you want to use jQuery in the box, you can call $ directly, whereas if you want to use jQuery on the main window from Box JS, you use window.parent.$.
Digioh provides features to facilitate safe development and testing on live sites. In traditional software development, there are completely different stage or qa environments running separate software instances from top to bottom. However, with Digioh it is actually more complicated to work with different Digioh accounts for test and production because custom JS and boxes would have to be manually copied between accounts to “deploy” the changes to production, a process which itself can be prone to error.
Instead, for new custom JavaScript development, Digioh supports Box QA Mode. This allows you to use a single Digioh account for QA and production, deploying test code to your production site, but without actually exposing it to real users. You can go through the develop, deploy, test cycle of software development without the risk of breaking your live site. Simply make the changes to Custom JS and then hit “Publish QA”. To activate the QA version when visiting the client site, put ?boxqamode on any URL (or &boxqamode if it already has a query string). QA mode is not just for JS, you can also use it to test new boxes and rules:
Note that when you hit Publish (to production) or Publish QA, you are really publishing everything in the account: any and all changes to boxes, conditions, and Custom JS. If you have a work-in-progress Custom JS sitting in QA mode and you (or anyone else with access to the Digioh account) hit Publish, all of your JS immediately is pushed to production. This means that a routine cosmetic change and publishing of a box, say, could inadvertently cause the release of broken JS to a live site. For this reason, Digioh has a “Lock Publishing” feature that prevents publishing to production/live:
Before making any significant JS changes, first lock the account for publishing, then test your changes in QA mode, then unlock the account to publish live. This prevents someone else or even yourself accidentally publishing broken JS to a live site. If you find an account already in locked mode and need to make production changes, check the account history by clicking the “vcard” icon next to the account name top right, as shown below. While the lock action itself isn’t shown, whoever locked it will likely be the last person with activity in the log, and you can ask them if they are done before unlocking.
In general, do not leave Custom JS in a broken or experimental state for longer than absolutely necessary. Always try to leave the account in a safe state: boxes, rules, and JS.
Digioh Custom JS runs in its own namespace, but you have access to the full DOM via provided variables. Page JS has access to the following:
Box JS executes according to a sequential pipeline of events for which you can implement handlers.
The table below shows customizable events in sequence. Loosely speaking, boxes initialize their iFrame DOM and then display. After this, they can submit, redirect, or change pages any number of times. Finally, the close event is a terminator. We show the submission pipeline separately below, because it is more involved.
Box Event | Context | Special Variables | Return Options |
Before DOM Ready | Box has just started initializing. You can prepare data here. | false: abort box display, cannot display again on same pageview | |
After DOM Ready | Box HTML created, ready for display |
| None (ignored) |
Before Display | Immediately prior to display |
| false: abort box display, can display again on same pageview |
After Display | Immediately after display | None (ignored) | |
Before Redirect | After button click and before processing redirect URL. See below for details of x. | x.element.text x.element.url x.element.action=url | false: abort redirect or... x: modify x.element.url and return x to dynamically alter the redirect. |
After Redirect | After processing redirect URL, immediately before browser page change | x.element.text x.element.url x.element.action=url | None (ignored) |
Before Download | After button click | x.element.text x.element.file x.element.action=file | None (ignored) |
After Download | Immediately before issuing browser download | x.element.text x.element.file x.element.action=file | None (ignored) |
Before Open Another Box | Immediately after button click | x.target_lightbox_guid | None (ignored). Note that this also triggers any Redirect and Close event JS. |
After Open Another Box | Immediately before page change | x.target_lightbox_guid | None (ignored) |
Before Change Pages | old_page still visible | x.old_page x.new_page x.name | false: abort page change |
After Change Pages | new_page now visible | x.old_page x.new_page x.name | None (ignored) |
Before Close | Immediately before close | None (ignored) | |
After Close | Immediately after close | None (ignored) |
The box submission pipeline is shown below in strict sequence, including “native” events that occur behind the scenes and cannot be overridden. This process is invoked when any box form is submitted.
Box Event | Context | Variables in Scope | Return Options |
Native: prepare form data | Populate x object from form data | n/a | n/a |
Before Form Validation | Prior to default form data validation. | x.email x.name x.phone x.custom_1 ... | false: abort submission. string: abort and show string as error message. x: modified form data, bypasses validation in next step. Field list detailed below. |
Native: validate form | Validation of form fields as configured in the Box Editor, e.g. required fields, email/phone syntax. | n/a | Skipped if Before Form Validation returned form data object x. |
After Form Validation | After default form validation | x.email x.name x.phone x.custom_1 ... | false: abort submission. string: abort and show string as error message. x: modified form data. Field list detailed below. |
Native: show loading | Display the loading “spinner” | n/a | n/a |
Before Submit | Immediately before submission | x.email x.phone x.custom_1 ... | false: abort submission string: abort and show string as error message. Field list detailed below. |
Native: send data | Inject a submission “pixel” into the DOM | n/a | n/a |
After Submit | 400 msecs after pixel inject | x.email x.phone x.custom_1 ... | false: do not perform box “after submit” action. Field list detailed below. |
Native: after submit action | Action configured at form level can be: close box, redirect to url, open another box, show thank you, show extra page. | n/a | This action is performed unless false is returned from prior step |
If your goal is to modify form data before submission, use the form data object x, modify it, then return it. You can do this in either Before or After Form Validation event handlers, the difference being that returning x from Before Form Validation will prevent the default configured validation from occurring. So for example, any fields configured as required in the Box Editor will not actually be required. Best practice is to use After Form Validation, unless you have a specific reason to disable the default validation for email and phone fields, which cannot otherwise be disabled.
Before and After Submit events are well suited for doing your own custom tracking calls, or sending data to other systems. There may be situations where you want to disable and replace the default after submit action (which is usually to show the thank you page), you can do this by returning false from the After Submit handler, after calling changePages, for example.
Note about race conditions: if the box after submit action is configured as a redirect, you need to be careful of race conditions. Digioh form submissions are fast, but rely on the browser to request a “pixel” that carries the submission data. The same is true of any asynchronous operations you perform in Before or After Submit handlers, they could potentially be aborted by the browser redirecting away from the page. If this is a problem for you, change the after form submission action configured on the Box to “Do Nothing”, and perform the redirect from Box JS After Submit with a longer delay. For example:
//After Box Submit - custom redirect
… your custom code ...
setTimeout(function() {
window.location.href = "http://www.yoursite.com/foo";
}, 2000); //Extended wait
The data object x is essentially a parameter object for Custom JS snippets, and it takes different forms depending on where you are in the Box JS Execution Pipeline. Details below.
Before/After Redirect: x
Before/After Download: x
Before/After Change Pages: x
Supported page names are:
Form Submission Pipeline: x
The x object can be modified and returned in Before/After Form Validation to dynamically alter the form data before submission.
Custom Field types and formats in x:
These are functions in the Digioh core designed to help with interactive debugging from the browser console.
DIGIOH_API.print()
Prints the output from your calls to console.log in Custom JS.
DIGIOH_API.printAll()
Print detailed logs from Digioh core and your Custom JS.
DIGIOH_API.printErrors()
Prints only errors generated from Custom JS or the Digioh core (e.g. exceptions).
DIGIOH_API.printConditionsOutput(boxShortId)
This prints the result of evaluated box conditions, which is helpful in diagnosing common “why is this box (not) showing” situations. Output is in JSON format, with the important property being rule_result true/false.
DIGIOH_API.get$()
This is the jQuery ($) object used by Digioh. If your site does not have jQuery natively deployed, you can use this for troubleshooting. Digioh uses a private namespace to avoid conflict with any existing jQuery installations. Note that this jQuery instance operates on the window/DOM in which Digioh is installed. $ is available from within Page JS, and also as the jQuery variable.
DIGIOH_API.reset()
Resets Digioh by clearing the Digioh dataLayer, Digioh specific cookies, localStorage, and sessionStorage. This is useful for testing when you need a “clean” session with respect to Digioh.
DIGIOH_API.resetAll()
This resets Digioh as above with reset(), and also clears all other cookies, localStorage, and sessionStorage.
By default, Digioh activates on the page DOM Ready event, and assumes that the DOM is stable and contains everything needed to evaluate box conditions and box JS. If your page has asynchronous JavaScript that may not be completed at DOM Ready, and you have Box JS or Box conditions that depend on the output, you will need to use the Digioh async callback feature. This is the Digioh activation sequence in order:
Digioh supports asynchronous callbacks via Page JS. The most common use for this feature is to coordinate the activation of Digioh on your site with your own JavaScript, or another technology. So, for example, you may wish to delay Digioh activation until your advertising code has fully initialized, so that Custom JS can reliably interoperate with it. To do this, in Page JS you check if the external code has been initialized and if not, use one of the callback options below to tell Digioh to wait and then try again. Both options simply require you to return a special string.
//At top of Page JS
if(!window.adnetwork.isReady) return “async_retry”;
//Do something with window.adnetwork
When returning “async_retry”, Digioh will automatically try running Page JS repeatedly at 300 millisecond intervals. It will continue doing so until a value other than “async_retry” is returned (or nothing is returned). Alternatively:
//At top of Page JS
if(!window.adnetwork.isReady) return “async_callback”;
//Do something with window.adnetwork
Returning “async_callback” allows you to explicitly determine when to re-run the Page JS. When you are ready for Page JS to resume, call the following function from anywhere in your own (non-Digioh) JS:
window.DIGIOH_API.LIGHTBOX.customJsOnDocumentReadyCallback();
The above retry/callback methods will completely halt execution of the Digioh javascript code. Therefore, until you tell custom JS to proceed, no conditions will be evaluated and no boxes will be displayed (including inline boxes). This is by design, so you have time to finalize your website state before Digioh proceeds.
In addition, if you have JS code on your site that uses Digioh output (e.g. custom rules or JS variables set by Page JS), you can call this function to check if Digioh has finished initializing:
window.DIGIOH_API.LIGHTBOX.isReady();
Digioh Custom JS has two namespaces with helper functions.
This section documents the api namespace. All global api functions can be called from the Console in Browser Dev Tools, where DIGIOH_API is synonymous. For example:
DIGIOH_API.getCookie(‘myCookie’);
Digioh provides several helper functions for cookies, supporting Base64 and LZString encoding.
api.setCookie(name, value, {expirationDays}) → undefined
api.setCookie('my_cookie', 'test', {expirationDays:30.4}); //Sets for *.domain.com
api.setCookie('my_cookie', 'test'); //Expires in 1 day
api.getCookie(name) → String
api.getCookie('my_cookie');
api.setCookieBase64(name, value, {expirationDays}) → undefined
api.getCookieBase64(name) → String
api.setCookieLZString(name, value, {expirationDays}) → undefined
api.getCookieLZString(name) → String
api.deleteCookie(name) → undefined
Using these helper functions guarantees consistency with the Digioh rules engine.
api.getUrlParameter(key) → String
var src = api.getUrlParameter('utm_source');
api.hideUrlParameter(key) → undefined
api.getCurrentUrl() → String
api.getHostname() → String
api.getPagePath() → String
api.getQueryString() → String
api.getUrlHash() → String
api.getLandingPageUrl() → String
api.getReferrer() → String
api.getLandingPageReferrer() → String
api.getClientIpAddress() → String
api.getClientId() → String
Digioh performs real-time geo-location, these functions return data consistent with the Digioh rules engine and form submissions. That is, this same data is used for targeting conditions and sent to Integrations.
api.getClientContinentCode() → String
api.getClientContinentName() → String
api.isClientInEU() → Boolean
api.getClientCountryCode() → String
api.getClientCountryName() → String
api.getClientRegionOrStateName() → String
api.getClientRegionOrStateCode() → String
api.getClientCity() → String
api.getClientPostalCode() → String
api.getClientTimeZone() → String
api.getLongitude() → String
api.getLatitude() → String
These functions are consistent with box conditions and form submission data.
api.getOperatingSystem() → String
api.getBrowserType() → String
api.getBrowserVersion() → Number
api.getDeviceType() → String
api.isMobile() → Boolean
api.isTablet() → Boolean
api.isDesktop() → Boolean
api.isAndroid() → Boolean
api.isIOS() → Boolean
api.isNewSession() → Boolean
api.isNewVisitor() → Boolean
api.getPagesNavigatedAllTime() → [Array of String]
api.getDaysSinceLastPageview() → Number
api.getTrafficSource() → String
api.getSearchEngineSource() → String
api.getTotalPageViews() → Number
api.getTotalSessions() → Number
api.getMVTestGroups() → [String]
These functions may be useful in Global JS, if you need custom logic specific to certain accounts. These correspond to the “User ID” and “GUID” visible at the bottom of the Profile Menu, top right, in the Digioh UI. They can also be called from the browser console, as an easy way to determine which Digioh account instance is running on a website.
api.getAccountId() → String
DIGIOH_API.getAccountID(); //Alternative call from browser console
api.getAccountGuid() → String
These functions relate to boxes but exist in the “global” context and so can be called from both Page JS and Box JS.
api.getBoxGUID(boxIDorGUID) → String
api.getBoxId(boxIDorGUID) → String
api.closeBox(boxId) → undefined
api.openBox(boxId, {evalConditions:boolean}) → undefined
api.closeAllBoxes() → undefined
api.getBoxType(boxId) → String
api.addBoxIntegration(boxId, integrationId) → undefined
if(!api.isClientInEU()) {
api.addBoxIntegration(52361, 72384); //Store PII if not in EU
}
api.removeBoxIntegration(boxId, integrationId) → undefined
api.resetBoxIntegrations(boxId) → undefined
api.getFormData(boxId) → Object
The Digioh dataLayer is an object stored in browser local storage that contains all previous form submission data for that user (actually, device/browser combination). When submitting a form, all dataLayer data is sent to Digioh and then on to any configured Integrations. We provide functions that allow you to directly read, write, and delete data from the dataLayer. The dataLayer object is structured as follows:
{
"email": "test@digioh.com", //"Top level" data layer
"first_name": "sdfsd",
"last_name": "sdfsdf",
"name": "sdfsd sdfsdf",
"phone
"opt_in": "true",
"custom_6": "false",
"custom_3": "1",
"165909": { //Box level dataLayer, key is boxapi.getId()
"custom_1": "aaa",
"main_custom_1": "aaa", //Page specific data fields
"ep2_custom_22": "hello from ep2_custom_22!",
"ep39_email": "sldfjs@zzzzzxxxx.com",
"ep39_custom_1": "ep39cust1",
"ep39_custom_17": "ep39cust17"
}
}
Essentially, there is a top level dataLayer, which is written to by all boxes, and each box also retains its own version of the dataLayer. In addition, page specific field data is written at the box level. When a box page form submits, it will write data for all enabled fields to the top level, the box level, and to the box-page specific dataLayer properties. Generally, we recommend using the top level dataLayer where possible, and box and box-page level dataLayer only when you need to partition the dataLayer by box. You have 50 custom fields available, to avoid unnecessary complexity we recommend “assigning” a unique purpose to each custom field, and use custom fields for only that purpose across all boxes. For example, if you can decide that custom_2 is always the date of birth, it will make Custom JS and Integrations much easier to create and maintain.
For the functions below, if the optional boxId param is provided, it will only operate on the dataLayer for that boxId, and not the top-level or for other boxes. Typically, you should omit the boxId and operate at the top level unless you have special data requirements unique to a particular box.
api.getDataLayerValue(key, boxId) → String
api.setDataLayerValue(key, val, boxId) → undefined
api.removeDataLayerValue(key, boxId) → undefined
api.getDataLayer(boxId) → Object
api.setDataLayer(obj, boxId) → undefined
api.clearDataLayer(boxId) → undefined
api.isPreview() → Boolean
api.debugger(optionalPurpose) → undefined
api.writeCustomFlag(flagId) → undefined
api.isValidEmail(email) → Boolean
api.reload({ … flags …} ) → undefined
api.enableReloadOnUrlChange() → undefined
api.isReady() → Boolean
api.logEvent({ … data … }, {exp, group}) → undefined
var data = {event_type : 'display'};
var options = {group : 'test1', exp : '01/31/2021'};
api.logEvent(data, options);
This section documents the boxapi namespace, functions that are specific only to boxes and not available in Page JS. You can access boxapi from browser Dev Tools if you are in the Digioh Box’s iFrame context (i.e. Right Click > Inspect the Digioh box).
boxapi.getName() → String
boxapi.getId() → String
boxapi.getBoxType() → undefined
boxapi.getBoxFrameWrapper() → object (jQuery Element)
boxapi.getBoxJQuery() → object (jQuery)
api.getAccountMetadata(key) → String or [{k:..., v:...}, …]
api.getWidgetMetadata(boxId, key) → String
boxapi.getPageMetadata(pageName, key) → String
boxapi.getFieldMetadata(pageName, fieldName, key) → String
boxapi.getElementMetadata(pageName, elementName, key) → String
//Find all metdata with key mdKey, optionalLevel = undefined, account, box, page, element, field
api.findMetadata(mdKey, optionalLevel) -> [Object]
[{
mdLevel : 'field',
mdKey : 'state_auto',
mdVal : 'name',
elementType : null, //null except for elements (text, button, image, html)
fieldType : 'select', //null except for fields
xName : 'custom_1', //null except for fields
xNameSpecific : 'ep1custom_1', //null except for fields
dlName : 'custom_1', //null except for fields
dlNameSpecific : 'ep1_custom_1', //null except for fields
boxSettings : {...}, //undocumented, null for account-level metadata
pageName : 'ep1', //null for account-level, box-level
domId : '#ep1_form_input_custom_1' //null for account-level
}]
Transitions between box pages occur automatically based on the box configuration, e.g. after form submit, or button actions. You can also manage page transitions in Box JS.
boxapi.showPage(pageName) → undefined
//In Box JS After Submit
if(api.isIOS()) { boxapi.showPage("ep1"); } //page with apple store download link
else { boxapi.showPage("ep2"); } //android store download link
return false; //prevent default action (best practice is configure “Do Nothing”)
boxapi.showMainPage() → undefined
boxapi.showThankYouPage() → undefined
boxapi.showExtraPage(pageNumber) → undefined
boxapi.isMainPage() -> Boolean
boxapi.isThankYouPage() -> Boolean
boxapi.isExtraPage(pageNumber) -> Boolean
boxapi.getPageName() -> String
boxapi.getPageTitle() -> String
boxapi.getPageJQuery() -> Object (jQuery)
These functions support common use cases for customizing the form validation and submission process.
boxapi.processSubmit({...}) → undefined
//Example submission after asynchronous external API call, in After Form Validation
var callback = function(status) {
if(status=='ok') {
//Put a flag in api object
api.doneAPI = true;
//Restart pipeline for final submit
boxapi.processSubmit({useSubmitLock: false});
} else { boxapi.showError("API said no"); }
};
if(!api.doneAPI) {
//First time through pipeline, start async API call
api.checkDuplicateEmail(x.email, callback); //Your custom API code
return false; //Don’t submit until callback
}
boxapi.getFormData() → Object
boxapi.showLoading() → undefined
boxapi.hideLoading() → undefined
boxapi.showError(errorMsg) → undefined
boxapi.showInlineError(errorMsg, fieldName, {pageName}) → undefined
boxapi.addBoxIntegration(integrationId) → undefined
boxapi.removeBoxIntegration(integrationId) → undefined
boxapi.resetBoxIntegrations() → undefined
boxapi.trackManualRedirect() → undefined
These functions allow you to read and write form data dynamically, outside of the form submission pipeline, e.g. to populate data before the box is displayed, or change forms based on user interactions. All of these functions accept a fieldName parameters with valid values as follows:
boxapi.setFormFieldValue(fieldName, value, {pageName}) → undefined
//Dynamically change radio button (custom_3 here) from Option 1 to Option 2
boxapi.setFormFieldValue('custom_3', 'opt2');
//Dynamically check standard opt in checkbox field
boxapi.setFormFieldValue('opt_in', true);
//Dynamically set a date field
boxapi.setFormFieldValue('custom_2', '01/10/2020');
boxapi.getFormFieldValue(fieldName, {pageName}) → String
boxapi.addDropdownOption(fieldName, submitVal, displayVal, {pageName}) → undefined
boxapi.removeDropdownOption(fieldName, submitVal, {pageName}) → undefined
boxapi.removeAllDropdownOptions(fieldName, {pageName}) → undefined
boxapi.hideFormField(fieldName, {pageName}) → undefined
boxapi.showFormField(fieldName, {pageName}) → undefined
boxapi.closeBox() → undefined
boxapi.hideElement(elementName, {pageName}) → undefined
boxapi.showElement(elementName, {pageName}) → undefined
boxapi.reloadWebPage({delayMsecs}) → undefined
boxapi.disableScroll() → undefined
boxapi.enableScroll() → undefined
boxapi.resetBox() → undefined
boxapi.resetPage(pageName) → undefined
Digioh boxes are deployed inside an iFrame, and all boxes have the same standard HTML structure that corresponds to box visual elements in the Editor: form, text blocks, buttons, images, and custom HTML.
Each box page has its own layout div, that groups the visual elements for each page, with standard naming. Every element in the box has a unique id, making it easy to use jQuery from within Box Custom JS to manipulate the HTML and CSS. Common use cases are to hide and show box elements, customize styles, and preset checkboxes or radio buttons dynamically:
//In Box JS After DOM Ready
$("#button1").hide();
$("#button2").css("background-color", "yellow");
$("#thxbutton1").css("font-size": "200%");
$("#ep1_form_input_custom1").prop("checked", true);
All box HTML is available at time of After DOM Ready, with the main page (layout) visible. Box pages are transitioned by hiding the current page layout div, and showing the new page. This means you can customize any page, even if it is not currently showing.
Another common use case is when you want to add custom logic for box interactions not supported by the box event model. Digioh provides built in hooks for box actions: display, redirects, submissions, page changes, download, open another box, and close. Digioh does not directly support custom handlers for button clicks, but you can easily implement your own handler as follows:
//In Box JS After DOM Ready
$("#button1").click(function() {
//Do something before the configured button action takes place
});
When working to manipulate the Box HTML, you can easily test and prototype using browser Dev Tools Console. This saves time by avoiding a full edit, save, publish, display, test cycle while you tune your CSS. Just select the lightbox-iframe as the JavaScript context: