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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:03:56+00:00 2026-06-05T21:03:56+00:00

Forgive the complete newbie question here – I know this is really basic stuff,

  • 0

Forgive the complete newbie question here – I know this is really basic stuff, but for the life of me I can’t figure it out. Javascript is relatively new to me, and this is the first time I’ve had to do this particular thing.

So, I’m trying to use a Modal to open an iframe – the page itself will have links to several modals, all of which need to be passed a different value. Rather than hardcode each of these, I’m trying to set it up in such a way that one function can be used and the links can pass the values as required.

The code I currently have successfully opens the modal, but a 404 error is inside it – plus the modal title shows + title + – so I guess I’m referencing it wrong (probably in the function?).

Heres what I’ve got, pointers in the right direction would be appreciated!

function openIframe(title,url){
    $.modal({
        title: '+title+',
        url: '+url+',
        useIframe: true,
        width: 600,
        height: 400
    });
}

.. and the link:

<a href="#" onclick="openIframe('Process Voucher','a_processvoucher.cfm')">Add</a>
  • 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-05T21:03:58+00:00Added an answer on June 5, 2026 at 9:03 pm

    To use the variables, don’t quote them; title was being literally set to the string +title+ (and the same for url).

    function openIframe(title, url) {
        $.modal({
            title: title,
            url: url,
            useIframe: true,
            width: 600,
            height: 400
        });
    }​
    

    It seemed you were getting confused over the concatenation syntax to join strings and variables; for example, see the following:

    var name = "Matt";
    var welcome = "Hi " + name +  ", how are you doing today?";
    alert(welcome);
    

    … will alert the string Hi Matt, how are you doing today?

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

Sidebar

Related Questions

Forgive a newbie, I don't even know how to ask this question properly: I
Forgive me for this basic question. I have loaded a set of data as
Forgive me if this is a stupid question, I know there have been similar
Forgive me if this is a silly question! But to run trinidad as a
This might seem like a dump question, but my complete ignorance with VbScript is
I'm new to Python so forgive me if this is basic, I've searched but
I'm a complete rails newbie, so forgive me if this is trivial. I have
First of all, forgive me, as my question may seem foolish, but I'm really
I'm a complete WordPress noob, so forgive any ignorance in the following question. I
Forgive me if this is a stupid question. I'm a bit new to mobile

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.