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 8548585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:31:51+00:00 2026-06-11T13:31:51+00:00

I created a simple test for a function to grab the video id from

  • 0

I created a simple test for a function to grab the video id from a youtube url and echo it out. It works fine as is but when I introduce jQuery code in the mix I receive this error NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument. The error is commenting the jquery.js file on line 7071. I have no idea what to do or what is exactly causing this. The code is below.

First File

<script src="http://code.jquery.com/jquery-latest.js"></script>

<input type="text" id="url" />

<input type="button" id="press" value="click" />

<div id="return"></div>

<script type="text/javascript" >

    $('#press').click(function () {

$('#url').val();

    $.post('ajax_youtube.php', {url:url}, function(data) {

        $('#return').html(data);

    }); 

    });

</script>

Here is the ajax_youtube.php file

<?php

function get_youtube_url($text) {

$text = preg_replace('~https?://(?:[0-9A-Z-]+\.)?(?:youtu\.be/| youtube\.com\S*[^\w
\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w]*(?:[\'"][^<>]*>| </a>))[?=&+%\w-]*~ix', 
'$1', $text);

echo $text;

}

$url = $_POST['url'];

get_youtube_url($url);

?>
  • 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-06-11T13:31:53+00:00Added an answer on June 11, 2026 at 1:31 pm

    You forgot to assign url to a value, $('#url').val(); should be var url = $('#url').val();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created two very simple Heroku apps to test out the service, but it's
I have created a simple expand/hide test script: <html> <head> <script type=type/javascript><!-- function showHide(elementid){
So' I'm getting in Unit Testing. I created a really simple Function to test
I created a simple test page on my website www.xaisoft.com and it had no
I created a simple test with SendKeys, and tried both SendWait and Send. Private
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and
I am using SQL Server 2008 Enterprise. I have created a very simple test
I installed JDeveloper 11.1.1.6 and opened a simple test project that was originally created
I created a simple application inspired by this example in order to test all
After having some trouble with object deletion, I ran a simple test: Created a

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.