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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:35:09+00:00 2026-05-26T21:35:09+00:00

I have an html that has a link: <a id=myLink href=/aa.html title=New Bangoo class=bangoo>Bangoo</a>

  • 0

I have an html that has a link:

<a id="myLink" href="/aa.html" title="New Bangoo" class="bangoo">Bangoo</a>

and I include a js file that has this lines:

$("#myLink").live('click', function() { 
var typi = 'Ginga';       
    $("#typeList").append('<option>' + typi + '</option>');        
});

aa.html has that:

<label for="typeList">Type</label>
<div>
   <select id="typeList"></select>
</div>

aa.html opens on a colorbox. Everything is OK but I can not append types to select list. It has no elements when it finishes to open. It used to work but now not working. It may be because of js file tries to append to list before html loads?

Any ideas?

EDIT:

When I do that it works:

$("#myLink").live('click', function() { 
alert('Wait Here!');
var typi = 'Ginga';       
    $("#typeList").append('<option>' + typi + '</option>');        
});

When I alert anything it waits and at this time it has enough time to append to select list. How can I sure that external link has loaded so I can start to append?

PS: My problem is that I am trying to append an HTML element that I load it after I click myLink. aa.html doesn’t place at dom at the beginning, I load it from an external source.

After external page loads at screen it has no elements at select list. When I try to run same code from Firebug it adds options to select list and works. It means that code works but there is a timing and asynchronism problem that I want to append elements to a select list before it locates at dom tree. I should wait loading it and after that run my code.

  • 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-26T21:35:10+00:00Added an answer on May 26, 2026 at 9:35 pm

    I solved my problem. colorbox plugin has a function onComplete so I used that function to be sure page loaded.

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

Sidebar

Related Questions

I have an HTML file that has a set of divs with the class
I have a HTML page that has a link to a PDF. This PDF
I have a html document that has this structure: https://i.stack.imgur.com/zrOq1.png <- sorry for link,
I have a HTML file that has code similar to the following. <table> <tr>
I have a html file that has invoice details I would like to know
I have an html link that has uses hover() (well, the hoverIntent plugin...but same
I have a script that generates a temporary HTML file that has links to
I have a .js.erb file that has the following line $(#<%= user#{current_user.id}_following %>).html(<%= escape_javascript(link_to(pluralize(@count,'tag'),
I have a webview that has some custom HTML loaded into it. In this
a) I have an html page that looks like this: <html> <head> <title>Page Title</title>

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.