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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:09:56+00:00 2026-05-29T23:09:56+00:00

The application is working on dreamweaver but when I try it on Chrome or

  • 0

The application is working on dreamweaver but when I try it on Chrome or IE it dones’t work. I know where the issue is but I don’t now how to fix it. It has something to do with applying variable as an img src. The code is setup at http://jsfiddle.net/v9rxH/

the issue is in the line

 $(".topImage").attr("src", "'" + obj[randomNumA].urlTop + "'");
 $(".middleImage").attr("src", "'" + obj[randomNumB].urlMiddle + "'");
 $(".bottomImage").attr("src", "'" + obj[randomNumC].urlBottom + "'");

when the browser renders it is show

 <img src="'http://placehold.it/300x100&text=SecondBottom'" class="bottomImage">

it’s adding additional single quotes(‘ ‘) in src. Based on that, I removed the single quotes and it shows the variable as text instead of it’s value.
What am I missing?
Thanks in advance. Rex

  • 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-29T23:09:57+00:00Added an answer on May 29, 2026 at 11:09 pm

    You’re putting the single quotes around it with "'" – you don’t need to, using .attr() handles that for you:

    $(".topImage").attr("src", obj[randomNumA].urlTop);
    $(".middleImage").attr("src", obj[randomNumB].urlMiddle);
    $(".bottomImage").attr("src", obj[randomNumC].urlBottom);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now that I have a read-only application working, I am working on the insert
i have used progress bar in my application..my application is working fine but the
I've try to implement integration tests for a working application (spring, hibernate, soap, cxf).
I got my application working Awhile back, but after completely and accidentally deleting it,
As my application working fine in Portrait mode but if i change it to
I've been working with C# and .NET for quite some time now, but am
I have a Guice enabled application working fine, but when I optimize it (i.e.,
I have an AudioQueue based application working almost perfectly. I'm suffering an issue, however.
I'm trying to get a console application working with the SignalR .Net Client but
This has happened quite a few times. Application working fine. Then I chose 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.