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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:12:46+00:00 2026-05-16T14:12:46+00:00

For a website I’m working on, I’ve created an embed function. This is just

  • 0

For a website I’m working on, I’ve created an embed function. This is just a call to a javascript on my server that injects some HTML on the remote server.

To make sure the embeds also get some Google juice, I’ve added a piece of html, so the embed code looks something like this:

<script type="text/javascript" src="http://myserver.com/myscript.js"></script>
<div id="embedSource">Source: <a href="myserver.com">mysite.com</a></div>

It’s easy to remove the last div with the source in it from the embed code. So I thought I’d just add a little detection script in the first “myscript.js” to detect the presence of the div with id “embedSource”.

Problem is: the javascript is always executed first, then the div is being added to the DOM and there is no way that I can add the embedSource div first.

I’ve tried to check using:

window.onload = CheckIfEmbedCodeIsComplete();

But this event is fired to early (Chrome, FF and IE). Even though for most browsers it should be enouugh (right?).
Also tried:

setTimeOut(CheckIfEmbedCodeIsComplete(), 5000);

But again, the check is being called immediately, not after 5 seconds as you would expect.

What can I do to still check if that div exists?

  • 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-16T14:12:46+00:00Added an answer on May 16, 2026 at 2:12 pm

    To answer my own question, I had to change the timeout call to this:

    setTimeout('CheckIfEmbedCodeIsComplete()', 5000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A website that I've been working on was originally created using XHTML 1.0 Transitional
website A: hosted on some free web host. website B: my server I want
My website is configured to display a custom HTML-page when an error occurs. This
My website sets and loads cookies that are 200 characters long. Is this too
Website: http://www.crystal-grace.so/compendium/resume.html http://www.crystal-grace.so/compendium/index.html CSS: http://www.crystal-grace.so/compendium/css/master.css Hi, for some reason the nav and section elements
My website at http://derek.genevievehoward.com/ will not display in Firefox, even though the HTML and
My website was designed for firefox, and now that I've got most of the
A website I've been working on will not match data using a PHP (preg_match)
My website has a sponsorship system that allows users to invite friends by email
I used javascript for loading a picture on my website depending on which small

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.