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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:18:21+00:00 2026-06-08T01:18:21+00:00

I did alot of searching and couldn’t locate an answer. This is the code

  • 0

I did alot of searching and couldn’t locate an answer. This is the code

<div id="uniquediv"></div>
     <script language="JavaScript">
            (function($){
               var srcitem = 'http://someURL_to_an_AD_tag';
                   $('<script/>', {
                      type:    'text/javascript',
                      src:     srcitem
                   }).appendTo("#uniquediv");
            })(jQuery);
     </script>

No matter what I do (tried many diff things), the js code falls outside the “uniqueid” div. I need it IN the div because the div has padding and I need to retain that since the js I am including is an ad and I need to have padding around it.

  • 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-08T01:18:22+00:00Added an answer on June 8, 2026 at 1:18 am

    (I completely retract my previous answer).

    When you do $("<script>") in jQuery, the script is downloaded and executed immediately. The .appendTo is likely not having any effect in that case, especially if the ad is doing document.write.

    document.write is probably the way to go in this case. I don’t think there is any downside really. If your ad src is static, you may even want to skip javascript entirely and just do a tag in your div.

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

Sidebar

Related Questions

I did a lot of searching on this subject, but I couldn't find anything
Before asking this i did A LOT of searching on the net. I just
I did some searching on this site and on google as well. But i
I did a lot of searching, but couldn't find a solution for my problem.
I tried and searched a lot, but did not find an answer for this.
I did some quick searching on the site and couldn't seem to find the
I did a lot of searching and cannot figure this out. I have a
After searching a lot i did not get any answers and finally i had
I did a lot search already but couldn't find a straight anwser. I have
i find a lot of questions about this problem but i did not solve...

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.