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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:40:07+00:00 2026-06-09T06:40:07+00:00

I have a javascript popUp function… popUp(title, body){ $(‘body’).append(‘<div id=popupWindow><div class=close></div> <h2 class=title>’+title+'</h2> <div

  • 0

I have a javascript popUp function…

popUp(title, body){
    $('body').append('<div id="popupWindow"><div class="close"></div>
        <h2 class="title">'+title+'</h2>
        <div class="body">'+body+'</div>
        </div>");
    // then on $('.close').click(func(){ remove() etc... } );
    // and keyCode == 13 remove();
}

that inserts the two arguments into popup window that is then inserted into the html of the document. I had the idea of having a <form> as body but it craps out??

I have tried various things and it would appear to be the html as the argument which is causing the problem. I have limited javascript/jQuery experience, so any help you guys/gals can give would be much appreciated.

Thanks,
Si

It’s not a complete copy – However your right, there was a stray quote i hadnt escaped in the form thanks guys (hour well spent for a typo…)

  • 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-09T06:40:09+00:00Added an answer on June 9, 2026 at 6:40 am

    Set an identifier for your form and use it in JavaScript code.

    <form id="myform"></form>
    
    
    popUp(title, body){
        $('#myform').append('<div id="popupWindow"><div class="close"></div>
            <h2 class="title">'+title+'</h2>
            <div class="body">'+body+'</div>
            </div>');
        // then on $('.close').click(func(){ remove() etc... } );
        // and keyCode == 13 remove();
    }
    

    By the way, there was an error with quotes in your append statement.

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

Sidebar

Related Questions

I have javascript code to open a popup window using the window.open() function. I'd
I have a JavaScript function as follows: function popup(username) { var req = createAjaxObject();
I have used JavaScript on body onload event I used this code: function timeMsg()
I have following pages: popup.html <script type=text/javascript> //requires function doFunction(){ alert(hi); } </script> <button
I want to make a javascript popup whit an advertisement, and then close down
i have a h1 header in-between divs containing javascript popup images (placeholders). i want
I want it to have a popup dialog javascript box. Instead of a new
I have Javascript function defined in the main index.html file. One part of this
I have the following: <EditItemTemplate> <asp:Button ID=wrqst_need_ind_btn runat=server Text = Create WR onClientClick=javascript:popUp('popup_createWR.aspx') CommandArgument='<%#
I have a site using javascript popup effect like this: <script type=text/javascript> var GB_ROOT_DIR

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.