Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 534881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:39:30+00:00 2026-05-13T09:39:30+00:00

I recently found out about oEmbed which is a fomat for allowing an embedded

  • 0

I recently found out about oEmbed which is “a fomat for allowing an embedded representation of a URL” basically you enter the url of a youtube video that you like and oEmbed will return the embedded code of the video in this page.

I want to give my users the option to either enter a url or embed code in a textbox. If is embed code it should leave the text as it is, but if it is a url it should get the embed code from oEmbed.

My problem is the following: how do I identify if the user paste an embed code or a url?


$(document).ready(function() {
    $('#embedCode').bind('paste', function(e) { 
        // time out until the value has been pased to the textbox
        setTimeout(function() {
            var code = $('#embedCode').val();
            var tagCount = 0;

            // Identify embedded code here

            if(tagCount == 0) {
                alert('LINK');
            }
            else {
                alert('EMBED');
            }
        }, 100);    

    });

});

I was thinking to add a method to count the the number of valid tags such as object and param but have had no luck trying to do this.

Any ideas?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:39:31+00:00Added an answer on May 13, 2026 at 9:39 am
    //Using a youtube video page as an example:
    
    if( $('#embedForm input').val().toLowerCase().indexOf('<object') > -1 )
    {
        //input value has an OBJECT tag
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only recently found out about URL rewriting , so I've still got a
I recently found out about livecoding where someone will program something on the fly
I've recently found out about protocol buffers and was wondering if they could be
I recently asked a question about IIf vs. If and found out that there
I recently heard of BDD and found it very similar to TDD. Which of
Recently, I found myself having to write up some concerns I have about race
I recently found a log statement in my projects codebase that says here i
I recently found LINQ and love it. I find lots of occasions where use
Ok, the more I use LINQ, the more I like it! I recently found
I've been using extension methods quite a bit recently and have found a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.