
Common Use Cases
Custom Calculations
BMI calculators, loan estimators, or any complex math based on user inputs
Third-Party Widgets
Embed calendars, maps, chat widgets, or social media feeds
Advanced Styling
Create unique visual effects or animations not available in standard elements
External Integrations
Connect to APIs, track custom events, or sync with external services
Properties
Element Tab

HTML Content
The main code editor where you write your HTML, CSS, and JavaScript. Supports full HTML5 syntax with embedded styles and scripts.Preserve Formatting
- No (default): Element renders with its own styling
- Yes: Inherits theme styles (fonts, colors) from funnel settings
Important: When visibility is set to “No”, the RAW element is not
rendered in the DOM, so scripts won’t execute. Use this to conditionally
run code based on user segments.
Working with the Fox API
Access FunnelFox functionality through the globalfox
object:
Examples
BMI Calculator
Calculate BMI from user inputs and display results:Embedded Video
Add a responsive video player:Custom Timer
Create urgency with a countdown:Dynamic Content Based on Time
Show different content based on time of day:External API Integration
Fetch data from your backend:Execution Context
When Code Runs
- Scripts execute immediately when the screen loads
- Code runs every time a user navigates to the screen
- No need for
DOMContentLoaded
or similar wrappers - Fox API is available immediately as
window.fox
Available APIs
Full access to browser APIs:- DOM: All document methods and properties
- Window: Global window object and methods
- Fetch: For API calls
- Local Storage: For persistent data
- All JavaScript: ES6+, async/await, promises
Scope and State
- Each RAW element runs in the global scope
- Variables persist within the same screen
- State doesn’t carry between screens (use
fox.inputs.set()
) - Multiple RAW elements on same screen share scope
Best Practices
Keep It Simple
Use RAW only when built-in elements won’t work. Native elements are
faster and more reliable.
Test Thoroughly
Always test in preview mode across different devices and browsers
before publishing.
Handle Errors
Wrap risky code in try-catch blocks. One JavaScript error can break
the entire funnel.
Optimize Performance
Minimize external requests, avoid heavy computations, and load
resources asynchronously.
Security Considerations
- No server-side code: Everything runs client-side
- Validate inputs: Never trust user data
- Secure API calls: Use HTTPS and proper authentication
- No sensitive data: Don’t embed API keys or secrets
- XSS prevention: Sanitize any user-generated content
Performance Tips
Limitations
- No server-side execution: All code runs in the browser
- No file system access: Can’t read/write local files
- Same-origin policy: CORS restrictions apply to API calls
- No Node.js: Browser JavaScript only
- Memory limits: Heavy operations may slow/crash browser
Troubleshooting
Script not executing
Script not executing
- Check element visibility isn’t set to “No”
- Look for JavaScript errors in browser console
- Verify script tags are properly closed
- Ensure no syntax errors in code
Styles not applying
Styles not applying
- Check CSS specificity conflicts
- Verify style tags are within the RAW element
- Try using !important for overrides
- Check Preserve Formatting setting
Can't access fox.inputs
Can't access fox.inputs
- Input elements must have IDs to create variables
- Variables only exist after user interaction
- Check exact ID spelling (case-sensitive)
- Use fox.inputs.get() not direct access
API calls failing
API calls failing
- Check CORS headers on your API
- Verify HTTPS is used for external calls
- Look for network errors in browser console
- Test API endpoint independently first
Element breaking funnel
Element breaking funnel
- Wrap code in try-catch blocks
- Check for infinite loops
- Remove or comment out code sections to isolate issue
- Test in preview mode before publishing
Next Steps
- Custom Code & Fox API - Complete Fox API reference
- Variables - Use data across your funnel
- Actions & Triggers - Combine RAW with visual actions
- Elements Overview - Learn about other elements