JavaScript

  • Web Developer Monthly - Nov 2018

    Web Developer Monthly November 2018

    Nov 2018

    Web
    Developer
    Monthly

     

     

    Welcome to another Web Developer Monthly. This month's edition contains news from the latest .Net open source projects, awesome frontend training resources and the odd JavaScript tips for you to try out.

    If you've spotted anything you'd like me to share for the next Web Developer Monthly let me know in the comments below or reach out to me on Twitter. Enjoy!

  • Web Developer Monthly - September 2018

    Web Developer Monthly September 2018

    Sept 2018

    Web
    Developer
    Monthly

     

     

    Welcome to another Web Developer Monthly. This month's edition contains some awesome JavaScript tips, great CSS tutorials and inspirational CodePens to get your juices flowing. If you've spotted anything you'd like me to share for the next Web Developer Monthly let me know in the comments below or reach out to me on Twitter. Enjoy!

     

     

  • How to validate a YouTube url using JavaScript

    validate a YouTube url using JavaScript

    Here is a little code snippet to help you validate a value to ensure it's a YouTube url using JavaScript.

    This regex here will ensure that the url supplied matches the criteria of a valid youtube url:

    • This is that it is from www.youtube.com or youtu.be
    • That it contains either a 'v=' querystring or has the id as part of the url supplied
    • It also makes sure that the id is 11 characters long.

  • How to extract a YouTube video id from a url

    how to get the video id from a youtube url

    If you're allowing customers to save YouTube videos on your site and you'd like to extract out the video id when storing into your database you could try using either of these options below.

    The thing to remember is that the YouTube url can be either:

    • Youtube.com
    • Youtu.be

    and the Video Id can be appended as a querystring parameter or as the last segment of the url:

    • YouTubeUrl?v=videoId
    • YouTubeUrl/videoId

Get In Touch

Follow me online at TwitterFacebook or Flickr.

You can also contact me by email.

Buy Me A Coffee

Latest Tweets


Buy Me A Coffee