In light of the recent COVID-19 pandemic - OPTASY would like to offer DRUPAL website support for any Health Care, Government, Education and Non-Profit Organization(s) with critical crisis communication websites or organizations directly providing relief. Stay Safe and Stay Well.

CodePen and JavaScript: Powerful When Used Separately So... What If You Used Them Together?

CodePen and JavaScript: Powerful When Used Separately So... What If You Used Them Together?

by Adrian Ababei on Jun 20 2016

A lot of devs are now using CodePen for a variety of front end web development tasks and tricks. CodePen can be used to create Pens which are made up of JavaScript, CSS and HTML. A great thing about CodePen is that you can see your results immediately, effectively making this tool indispensable for any front end dev. But what can we do if we combine JavaScript and CodePen?

1. Add any library you need in one place

You can add custom settings to any Pen you create: you can set the External JavaScript you need or want to use. Just go to the Quick Add dropdown to do it or simply start typing the required library and a variety of choices will appear. This way you’ll be able to find thousands of CDN hosted libraries.

2. Write in ES2015

Practice your ES2015 skills with CodePen by simply enabling the Babel JavaScript pre-processor. Now you’re able to use ES2015’s features and Babel will process them into an older version of JavaScript, enabling it to work everywhere. You can also do it without using Babel whatsoever but it may lead to browser support issues.

3. You can use the console for debugging and output

With CodePen, you can also use your browser’s DevTools if you set its context to demo. CodePen also features a built-in console which you can use. Keep in mind that your URL might change when you close or open different code panels. There are four numbers which stand for HTML, CSS, JS and Console respectively so the URL parameter ?editors=0001 stands for Console open while the others are closed. Replacing the last number with a 2 maximizes the console. This way you can share a Pen when the output is intentionally set only for the console.

4. Use JSX and React

Babel also supports JXSX so if you add ReactDOM and React you’ll be able to build in react as well. Apart from Babel, CodePen also offers LiveScript, TypeScript and CoffeeScript. TypeScript is able to process the JSX as well.

5. You can also include other pens as resources

Using JavaScript for another Pen is also possible by simply dropping the URL of your other Pen in the External JavaScript function and that’s all there is to it. You’ll be able to create multiple Pens that use the same JavaScript – this way it will be easier to update it when necessary.

This little trick also works for CSS in the same way. When it comes to HTML you can include the Pen URL in triple brackets within the HTML itself.

6. Get Ajax from other Pens

With CodePen you can use other Pens as resources and you can access the code from Pens located at certain URLs. If you want to access just JavaScript from another pen, you can add .js to the end of the URL you’re targeting.

This technique can be especially useful when storing data in another Pen so you won’t have to meddle with the JavaScript code in the Pen you’re currently working on.

7. Learn new stuff with CodePen

Devs can use CodePen as a learning tool as well – it’s real code which you can write, edit but also see the results of. You can create Pens for learning purposes specifically but our favourite is the Professor Mode which allows other devs to watch you code in real time and give pointers through the built in chat system.

Collab Mode is another useful tool which can be used for teaching purposes – this mode allows multiple people to work on a Pen concurrently for hands-on teaching.

8. You can see coding errors in real time

Another feature we love about CodePen is that you can see any errors in your code right in the editor itself. This feature also works for JavaScript – the lines with errors will be highlighted and a special icon will be revealed. Clicking the icon will reveal the error message which is a huge help in understanding the problem and fixing it.

CodePen also tries to prevent executing infinite loops which can lock your browser and prevent you from saving your Pen.

9. Lint your JavaScript

CodePen can check your JavaScript code with JS Hint as well. This is a tool which detects potential problems or errors in your code. Use this tool to uncover non execution stopping errors most devs tend to miss. If the error message doesn’t provide enough help for you to fix it, there are built-in “Google it” links to find more information.

CodePen also lints your JavaScript which is great because if you’re using a pre-processor, it will lint the code for linting warnings. If JS Hint finds any issues it will show you the problems directly in the code.

10. Clean code – easier work

CodePen also has a feature which can help to clean up your code. This feature works with JSX as well.

 

Development

We do Web development

Go to our Web development page!

Visit page!

Recommended Stories

The SEO Shopify Checklist: How to Get Your Store to Rank Higher Fast in 10 Steps (Part 1)
You've just opened your Shopify store. Now, you want to make it easy to find in the search engines (obviously!). So, you're working on its SEO. And you ask yourself: "Is there an easy-to-follow SEO Shopify checklist that I could use to get my store to rank higher on Google... fast?" Higher ranking on Google » Higher traffic » More sales. The butterfly effect of good Shopify SEO... To give you a hand with that, we've reviewed our own process for improving the SEO of our clients' Shopify stores. And we've extracted the 10 most common adjustments that you, too, can make to give your new Shopify store a boost in the searches... quickly. But First: Is the SEO for Shopify any... Different? Can we really talk about "SEO Shopify vs BigCommerce"? Or "SEO Shopify vs Woocommerce or WordPress or..."? What makes the SEO approach for Shopify stores any different than the one for any eCommerce websites? There are some nuances that make it somehow unique: SEO particularities when it comes to crawling and indexing that you'll need to be mindful of the fact that you cannot edit the robots.txt file in Shopify (so, you'll need to come up with an alternative solution for that) issues related to duplicate content that are specific to Shopify  ... Step 1: Create a Strong and Logical Structure for Your Website "The better your site structure, the better your chance of ranking higher in the search engines." (Neil Patel) "How to optimize SEO on Shopify?" You go ahead and set up a powerful structure for your site. "What's a powerful structure?" you ask? A structure that makes it easy for the user the navigate the content and for the search engines to understand your website (that is, to crawl it and to rank your products). Which can only lead to: a great user experience a higher ranking in the search results A "powerful website structure" based on a logical hierarchy: Main categories  » Subcategories  » Products. In the context of a Shopify store, an example of a "good structure" would be: Homepage » Collection pages » Product pages  Tip! Keep it simple. A too complex maze of categories and subcategories will only discourage your users. Good to know! In Shopify, the "collection" pages stand for the product category pages. Step 2: Choose Your Keywords (A Key Point on Your SEO Shopify Checklist) "How to set up SEO for Shopify?" You go keywords hunting, that's how. Where to start? There are 2 paths that you can take: the free one the paid one (aka, choosing one of the SEO Shopify tools to search for the best keywords) 2.1. The Free Way to Find the Best Keywords for Your Shopify Store Here are 4 simple methods that you can use to identify the most suitable keywords:   explore forums and subreddits related to your products   analyze the social media hashtags related to your products   make a list of 5 key topics that your customers are interested in, which are closely related to your products (i.e. if you sell bicycles, your buyer personas might care about "bike riding lessons", about "how to store a bike outside" or about "bike wear and shoes"...)   scan the title tags, image alt-texts, and meta descriptions on your competitors' websites and see what keywords they're targetting   Note! These are all non-data-driven ways to search for keywords.  2.2.The Paid Way to Look for Keywords: Using Keyword Search Tools If you don't feel like doing any guesswork when it comes to choosing the best keywords for your Shopify store, just use one of the best tools available: SEO Metrics Moz's Keyword Explorer (use it to spot high priority keywords and to uncover new keyword opportunities) Ahref's Keyword Explorer (i.e. you can use the "Content Gap" report to identify those keywords that your competitors' webshops rank for and yours doesn't) Google's Keyword Planner ... And here are a few more simple strategies to get keywords ideas: list of all those keywords that are currently getting most clicks your Google Search Console find and target those Google AdWords keywords that generate the most revenue for your Shopify store  When doing your research, you'll want to find the (almost) perfect balance between search volume and keyword difficulty.  And always make sure that the keywords you've selected align with the search intent. Tip! Target long-tail keywords. Conversational, natural language search queries are powerful enough to boost your website's ranking on Google. Step 3: Keyword-Optimize Your Pages (Titles, Meta Descriptions, URLs...) With your list of keywords at hand, it's time for you to sprinkle them strategically throughout your website. Here are the best spots to place them: your pages' title tags (homepage, product pages, category pages, blog posts) the meta descriptions the URLs the page content (i.e. in your product's descriptions) the image Alt tags Now that you know what are the "hot spots" on your website, here are some Shopify SEO best practices for optimizing them: keep your page title tags under 60 characters write a unique title tag and meta descriptions for each page keep your meta descriptions under 155 characters place your focus keyword at the beginning of the meta descriptions Step 4: Target One Focus Keyword per Page And this is another critical step on your SEO Shopify checklist to be mindful of. Make it even more powerful by linking it to another SEO best practice: Mapping keywords to content types.  It's still one of the top SEO tips for Shopify. Meaning that you target specific types of keywords for each type of page on your website — blog posts, product pages, homepage, category pages, etc. Let's say that you're selling kombucha tea on your Shopify store: You'll want your blog posts to target searches for information ("what is kombucha"), and your product category pages to target lower search volume, but which point out to a strong intent to buy ("buy kombucha in bulk"). Step 5: Optimize Your Product Category Pages “To help category pages rank better, we advise our clients to not only have a list of product names, thumbnails and ‘view more’ buttons, but to turn this page into an experience that helps the user with making a decision,” (Arsen Rabinovich on searchengineland.com) This is one of the SEO optimizations on Shopify best practices that more and more eCommerce brands have been adopting these days. So, how about seizing this opportunity to have your Shopify store rank higher than your competitors'? By upgrading your product category pages from... mere lists of products to influential touchpoints in your customers' buying journeys. To pages that deliver a richer experience. Pages that provide more informational type of content, aligning with the user intent. 5.1. Best Practices for Optimizing Your Category Product Pages: display star ratings, tips, recommendations, user comments ... excerpts from product descriptions, related products, FAQs create content around users' questions feature direct access to your blog posts related to that specific product type use a combo of fresh and evergreen content on your collection pages Make it useful, make it relevant. You want those pages to rank high, but you also want them to deliver a rich user experience... 5.2. Best Practices for Optimizing Title Tags for Categories You know now how to optimize the content on your collection pages. But what about their title tags? Is there a formula to keyword-optimize those titles? There is: Keyword 1 – Shop for Keyword 2 – Store Name For example: Trek Bikes – Shop for Trek Bike Online – The Store That's it for today! But stay tuned for the Part 2 of this post, where we'll be sharing 5 more steps to add to your SEO Shopify Checklist. Now, if you find these tips on how to optimize our store for higher ranking too time-consuming and overwhelming, just shift the "burden" to us. Drop us a line and let's come up with a fine-tuned SEO strategy for your Shopify store. One that'll guarantee it the ranking and traffic that it deserves.   Image by Abdul Rehman from Pixabay ... Read more
Adriana Cacoveanu / Jul 16'2020
”Why Would I Use Shopify to Start My Own Online Store?” Top 7 Reasons
You either ride the wave or drown in it (yes, I am talking about the new e-commerce reality that COVID-19 has brought). So, you’ve decided to go ahead and open up your own online shop and you ask yourself: “Why would I use Shopify?” Why not... BigCommerce, for instance? And you know that going through this digital transformation is going to be painfully challenging since you’ll need to: go through the entire process of building your online store (obviously!) make sure the servers will withstand huge (hopefully) amounts of traffic actually ship your products  handle those scenarios where customers return their products handle all the marketing of your online business … With so much on your plate, the last thing you need is a complex or a too rigid eCommerce platform. One that would make setting up and managing your store even more cumbersome. But still: why Shopify? Here’s why: 1. You Can Start Your Own Shopify Store with… Zero Technical Skills And this is one of the key reasons why it’s the best eCommerce website builder, particularly for small businesses. Shopify handles all the technical stuff for you: backups, security, web hosting, updates. Unless you need some more advanced features than the ones it provides you with out of the box. Otherwise, you’re good to go: you can set up your store in no time, with no computer science degree. Talking about empowering entrepreneurs, right? 2. “Why Would I Use Shopify?” Because It’s the Easiest to Use The question "Can I build my own eCommerce website?” has one simple answer: Definitely! With Shopify, you can set up your storefront and start loading in products in a few hours.You have an intuitive interface “at your service”, enabling you to get everything up and running with… no single line of code. It’s conveniently easy to use, with your store ready to go pretty much right out of the box. 3. You Get Everything You Need to Run Your eCommerce Business And I’m talking here about: web hosting deep insights into your customer behavior via its easy to navigate dashboard (Are they abandoning carts? How long are they hanging out in your online shop? Which social media channels do most converted customers come from?) advice on the measures you could take to boost your sales transaction management a dedicated payment gateway: Shopify Pay (while it also integrates smoothly with Amazon Pay, PayPal, Stripe, Worldpay) integrations with Google and Facebook and other platforms, as well In short, Shopify takes care of everything online store management-related for you. 4. You Get a Fast and Low-Cost Shipping Service “Why would I use Shopify for my eCommerce store?” Because you get access to a network of thousands of third-party logistics providers. And this is gold particularly for small eCommerce businesses (with big plans), who don’t have a global logistics network. In this respect, Shopify Fulfillment Network taps into machine learning to guarantee you deliveries on time (two-day shipping) and lower costs for your shipping. And speaking of shipping (and empowering eCommerce businesses), you’re free to choose the shipping option that best suits your needs: by product weight by delivery speed by the region on the globe that you’re shipping to 5. You Get a Large Collection of Apps to Add More Functionality to Your Store It’s what makes Shopify one of the most “tempting” eCommerce platforms: You get to start small, using its built-in features, then… scale up, adding more power to your eCommerce business via add-on apps. And, thank God, there are thousands of them in the Shopify App Store. Ranging from: reviews sections to chat feature to the feature of converting prices to international currency  to email marketing tools (if your chosen theme doesn’t already provide you with such a feature) … you can browse, choose, and add any type of new functionality that you need to “inject” into your web store. And since scanning through such a rich collection of third-party apps can get overwhelming, just make sure you go with the best-rated ones. It’s the best criterion to filter them by.  6. You Get a Whole Range of SEO Tools to Rank Your Store Higher in Search “Why would I use Shopify to create my online store?” Because it “spoils” you with a heavy load of built-in SEO tools to help your store get found: it prompts you with SEO best practices whenever you add a new product to your catalog you get header code and custom URL multilingual options reporting tools blogging 7. You Get a Rich Collection of Themes, Specifically Designed for eCommerce This is another strong reason why Shopify’s still one of the most popular eCommerce website builders. It provides you with one of the most impressive collections of stylish, clean, professionally designed themes. Themes that you get to browse through by: industry: food and beverage, art and photography, home decor, etc. price popularity style: “fun and lively”, “minimalist”, “great for small inventories” Good to know! The Shopify Express theme is the theme to go for if you need to get your store online… yesterday. If you don’t have tons of images for your product catalog and you need to get online fast, this theme’s the one for you. When it comes to built-in features, all Shopify themes ship with: social media icons drop-down navigation support free stock photos by Burst SEO customizable content sections on the home page mobile-friendly design free theme updates built-in styles and color palettes Prioritize those themes that ship with features that are critical for your store over the great looking ones that… lack them. Otherwise, you’ll need to look for (and pay for) Shopify apps to compensate for the missing features. In other words: Why not make your life easier from day one, going for a theme that helps you check most of the features off you wishlist? You’ll find it more… natural and easier to design your product pages around your products, then to style them with no products to feature. The END! Are these reasons strong enough to answer your question: “Why would I use Shopify for my online store?”. But what if you’re not that thrilled about the idea of a DIY store? Maybe you don’t have the time (or you simply want to invest it in other projects) to get into the nitty-gritty of building your own online store, from A to Z Or what if you: need a fully custom Shopify app for your store? One that should store a particular functionality that you need incorporated into your shop? … or maybe a theme that’s tailor-made to suit your specific business needs and to do your brand justice? want to customize your product page or your checkout form? We’re here to help you make the most of Shopify and fine tune it to your needs. Just drop us a line and let’s build your powerful online presence. Image by Akash Sanchihar from Pixabay   ... Read more
Adriana Cacoveanu / Jul 13'2020
The Complete Website UX Audit Checklist for 2020: 12 Steps to Uncover Usability Issues on Your Site
Users come to your website. They start the checkout process and... leave. Why is that? Is there a "best practice" process to identify the pain points in the user journey? A website UX audit checklist that you could use? And how would you know: what to include in your audit? what pages to review? how to interpret all the collected data and turn it into actionable insights? You've got the questions, we've got the answers. And we've included them all in an 11-point checklist to run whenever you want to assess the user experience on your website: What Is a UX Audit More Precisely? Source: process.st Let's go back to the example above: You notice that visitors on your website keep abandoning their shopping cart.  In this case, a website UX audit might uncover specific flaws in the customer journey responsible for this low conversion rate: confusing navigation structure cluttered screens a too complicated checkout process an inconsistent visual style across pages not enough payment options In other words: A UX audit helps you identify all those usability challenges with a direct impact on users' experience. key elements on your website that are too hard to find ... or too hard to use the workflow users are to perform is not that obvious and intuitive And it helps you find your answers to legitimate questions like: What is working and what isn't? What metrics are your collecting and what metrics should you be collecting? What does the gathered data tell you about your website users' needs? Why do they behave the way they do and how might they behave once you've taken follow-up action? In short: a UX audit provides you with those metrics which, once turned into updates to your website, help you boost conversions. Step 1: Run Stakeholder Interviews and User Surveys Start off by talking to your: development team, the one in charge with all the UX improvements on your website; ask them about their development challenges, future plans with the company website, and specific requirements for achieving those plans marketing team and salespeople, who might already have their own user survey results collected along the years Then, run your own updated user surveys and categorize results by: task severity findings per screen  Tip! Run usability tests to filter through the qualitative data collected on these interviews and surveys. For instance, users might report a discouragingly complex checkout process. A usability test will confirm or disprove this claim. Step 2: Create Your User Persona- A Key Point in the Website UX Audit Checklist Who are you improving your website UX for? And there are different types of users visiting your website and each user type stands for a unique way that you could improve the user experience delivered there. To narrow down your options, you need to figure out who's the most representative user for your website.  Remember to add these 3 key attributes to your user persona as you're building its profile: user goals: do they align with your business goals? needs: what does he/she try to accomplish when visiting your website? frustrations: things to avoid when designing this user persona's experience on your website Tip! Bring your business goals (that we'll be focusing on at Step 3) into the picture, as they'll help you determine who your user persona is. Also, while at this stage in your UX audit, answer these 3 crucial questions: what are your visitors' demographics and behaviors on your website where do they come from to your site? are current visitors also your target users? Step 3: Get Specific with Your Business Goals  Let me guess: Your business goals tied to your website are related to conversions and revenue. At this step of the audit, you'll want to clearly define those goals that a better UX can directly impact. Once you've defined your business goals, include these key questions into your website UX audit checklist: What's my business goal? What's the key user goal? What actions do I want users to perform on my website? What are the top brand values that I want to communicate to my website visitors? What are my key sales channels? Who are my top competitors? Step 4: Perform a Cognitive Walkthrough of Your Website  ... to see things through the visitors' eyes. Try to perform those actions that users come to your website for. And stay vigilant to detect any obstacles that might stop you or slow you down when trying to achieve your "user" goals. Tip! Since you already know all too well how your website works, base the whole process on established criteria. This way, you can keep your focus on those user goals. Step 5: Dive Deep into Your Data Analytics Your website analytics reports make some great insights into how great or... less than great the user experience delivered on your site is. Use it to "fuel" your UX audit with, as it'll provide you with key information on: conversion or cart abandonment what visitors were doing before accessing your website (most common entry points to your website) specific user flows on your site traffic metrics hotspots on your website Tip! Filter your data analytics by specific segments and timeframes.  Source: uxbooth.com Supplement the valuable data that you get from Google Analytics with reports provided by tools like: Kissmetrics Hotjar Crazy Egg Step 6: Determine Your Conversion Rate Performance Is your website an eCommerce one? Then you'll want to take a close look at your sales and download figures as you try to improve your site with a UX audit. Figure out how well your website copy supports the overall user experience and whether your website meets visitors' pain points. Step 7: Identify Your Highest Converting Pages Another crucial point to add to your website UX audit checklist. Why? Because the pages with the highest conversion rate give you an insight into what UX is doing right on your website. They stand for some successful customer journeys that you'll want to get inspired by and... replicate on other pages on your site, as well. Step 8: List Your High-Traffic Pages with a High Bounce Rate "How to perform a UX audit?" One of the essential tasks to add to your "To Do" list is identifying those high-traffic pages with a high bounce rate (above 70%). Step 9: Identify Strong Points and... Pain Points in the User Journey Where does the user step off the intended path? Why is he/she failing to take action? It's the strong points in the customer journey (those high-converting pages that you've listed at Step 7 are the best places to look for them) that'll provide you with the best solutions for fixing the weak points identified at this step. Step 10: Take a Close Look at Your Site Layout Your website layout is directly "responsible" for a great deal of the user experience delivered on your website.  So, at this point in your website UX audit checklist you'll want to check specific aspects of your site layout with a direct impact on the visitors' experience: Does it manage to meet visitors' needs? Is your website navigation intuitive enough and easy to use? Is your on-site search accessible enough? Is your website copy in line with the user journey? Step 11: Run a Competitive Analysis How will this help you? You identify your target customers' expectations when interacting with websites similar to yours. That sell the same type of products or services. What's those sites' traffic compared to yours? How usable are they? How well do they rank in the search engine results page? Seize any opportunities that your competitors might have missed. Or get inspired by what they do great in terms of user experience and... do it better on your own company website. Step 12: Organize Your Findings Into a UX Audit Report And use categories like: major usability issues A/B test suggestions challenges predicted impact ... to sort and group your results. 3 Tips to Keep in Mind When Conducting Your UX Audit I've saved 3 best practices for last. Apply them to streamline the whole process and to future-proof your findings. Group all your findings into buckets. It'll bet easier for you (and your team) to interpret your findings when you group them into categories (e.g. the "website navigation UX issues" category) Take screenshots of all the issues found. In other words: screenshot everything! It's the easiest and most effective way to document every aspect (web page, interaction, etc.) of your website with a direct impact on the user experience. Look for trends. Use your spreadsheets of UX findings to identify... patterns. Are there any common conventions and structures that visitors expect to find on your website? That they're already familiar with?   The END! I think I know what you're thinking right now: "But taking all the steps included in your website UX audit checklist takes... ages! And during all this time I'd have to put my team's projects on... hold." Not if you pass on the audit "burden" to us. Just drop us a line and let's uncover all the opportunities for UX optimization on your website! Image by Mudassar Iqbal from Pixabay     ... Read more
Adriana Cacoveanu / Jul 01'2020