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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:55:08+00:00 2026-05-11T16:55:08+00:00

In Ruby you can use string interpolation like so: text = This is visit

  • 0

In Ruby you can use string interpolation like so:

text = "This is visit number #{numVisits} to this website"

This bypasses the need for explicit concatenation.

I’m working with jQuery and have a bit like this:

$(document).ready(function(){
    $("a.ajax").click(function(event){
        $("#content").load("data.html this.getClass");
    });
});

The behavior I want is “click on <a class="ajax" id="schedule"></a> and the content div on the current page is replaced by the schedule div from data.html. If I manually write in

load("data.html #test"); 

that works, but I want the script to load the DIV with the ID value of the anchor clicked. Any help would be swell!

Example Page: http://www.mariahandalex.info/stack/

  • 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-11T16:55:08+00:00Added an answer on May 11, 2026 at 4:55 pm

    You cannot embed javascript code inside a string, but you can concatenate a string to an object using ‘+’ like so

    $('#content').load('data.html #' + $(this).getClass());
    

    About embedding code in a string, I don’t think it has a name. Groovy calls those strings “Gstring“s, and ruby calls those ‘Expression substitution in strings‘. I’m not sure it has a standard name.

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

Sidebar

Related Questions

In Ruby 1.9, I can use its class variable like the following: class Sample
In Ruby I can use result << (yield element) and everything works, but if
is there some ruby code I can use to install a gem from a
I install ruby via rbenv-installer . When I use irb console, I can use
In Ruby I can call methods with array elements used as positional parameters like
In Python, we can use the .strip() method of a string to remove leading
I come from the Ruby world. How do I use the string value of
I have a Ruby string that can sometimes contain some non-printable characters. Before I
I use Ubuntu 11.10 and ruby 1.9.2 I can not install thrift gem on
In ruby it would look like myfunction ([element1, element2, element3],other argument) Can I do

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.