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

  • Home
  • SEARCH
  • 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 8991197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:40:21+00:00 2026-06-15T22:40:21+00:00

I´m building a social network with Grails and got stucked on giving users inner

  • 0

I´m building a social network with Grails and got stucked
on giving users inner their editprofile
page the chance to paste an youtube-Url into a textfield and by clicking a button a JS regexxes the id out of the URL pasted, an ajax post is fired updating a div with a preview image of the youtube video

the html looks like :

                    <g:textField name="videoinput" class="videoinput reLef" value="" />
                    <span class="daten_videouploadbtn reLef" ></span>

        <g:render template="/forms/storedVideos" />

the JS looks like :

    $('.daten_videouploadbtn').click(function() {

        var string = document.editProfileForm.videoinput.value;
        var neu = string.replace(/http[s]?:\/\/(?:[^\.]+\.)*(?:youtube\.com\/(?:v\/|watch\?(?:.*?\&)?v=|embed\/)|youtu.be\/)([\w\-\_]+)/i, '$1'); 
        var id = RegExp.$1;

        jQuery.ajax({
        type:'POST',
        data:RegExp.$1, 
        url:'${createLink(action: 'addVideo')}',
        success:function(data,textStatus){jQuery('#storedvideos').html(data);},
        error:function(XMLHttpRequest,textStatus,errorThrown){}
        });
});

the controller looks like :

def addVideo() {
    def videoitems = !!%%-- HOW TO PARSE YOUTUBE-ID HERE -%%!!
    render(template:"/forms/storedVideos", model: [newVideo:videoitems])
}

and stored videos looks :

    <div id="storedvideos"><span><img src="http://img.youtube.com/vi/${newVideo}/default.jpg" width="225px" height="130px"/></span></div>

i just dont get it how to catch the data of the Ajax Post and update the div with the preview image with the id inside,

can someone give a hint ? it is killing me

  • 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-15T22:40:23+00:00Added an answer on June 15, 2026 at 10:40 pm

    You should post the data like this:

    jQuery.ajax({
      type: 'POST',
      data: { value: RegExp.$1 },
      ...
    

    After that you can access the posted data inside your grails controller with params.value.

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

Sidebar

Related Questions

I am building a social network (connections and their connections, messages and locations) and
I am building a server back-end for a mobile social network using Windows Azure.
I am working on a user based social network. I am building the site
i am building a social network platform, as a platform to learn web development.
I'm trying to create a social-network like feature in an app I'm building, and
I'm building a service, kind of a social network, that is expected to attract
I'm building a social networking website. I have a table of Users. Each user
I am building a social network in mongo db. Following is the structure of
Hi I am building a social network in dreamweaver using php and sql as
I am building a social network in Ruby on rails. I am trying to

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.