Embedding Common Ninja widgets into your website enhances its functionality and user engagement.
Common Ninja offers two primary methods for embedding widgets: using our JavaScript (JS) SDK with a div placeholder or an iframe element. While both methods allow for the integration of our powerful widgets, they come with different implications for your website's performance and widget functionality. This article will guide you through the best practices and considerations for each method to help you make an informed decision.
Recommended Method: JavaScript SDK with Div Placeholder
The JavaScript SDK method is our recommended approach for embedding widgets due to its seamless integration and dynamic capabilities.
Advantages:
- Full Functionality: Access all features and updates instantly, ensuring your widget performs at its best.
- Dynamic Content Updates: Content updates in real-time without needing to refresh the page.
- Responsive Design: Widgets automatically adjust to the screen size, enhancing mobile compatibility.
How to Embed Using JS SDK:
- Place the provided div placeholder in your HTML where you want the widget to appear.
- Include the JS SDK script tag in the head or body of your HTML.
- The widget will initialize automatically within the div placeholder.
Alternative Option: Iframe Method (not available in all widgets)
Using an iframe is a straightforward method to embed widgets but comes with certain limitations.
Caveats:
- Limited Functionality: Some advanced features may not be available or perform optimally.
- Static Content: Dynamic content updates require manual refreshing of the iframe.
- Potential Styling Issues: Responsive design might be constrained, affecting mobile responsiveness.
How to Embed Using Iframe:
- Copy the iframe code snippet provided in our editor.
- Paste it into your HTML where you want the widget to appear.
- Adjust the width and height parameters as needed to fit your layout.
Making the Right Choice
While the iframe method might seem simpler for quick embeds, it's important to weigh the benefits against the limitations. For a fully featured and responsive experience, the JS SDK method is the way to go.
Need Assistance?
If you encounter any issues or have questions about embedding our widgets, our support team is here to help. Contact us through our support channel for personalized assistance.
Conclusion
Choosing the right embedding method is crucial for maximizing the functionality and user experience of Common Ninja widgets on your website. By following these guidelines, you can ensure a smooth integration and take full advantage of what our widgets have to offer.
Comments
0 comments
Article is closed for comments.