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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:09:04+00:00 2026-06-15T14:09:04+00:00

here’s my problem: I’m using ddSlick plugin to achieve language drop-down with flags. The

  • 0

here’s my problem:

I’m using ddSlick plugin to achieve language drop-down with flags. The problem is that I’m creating this drop down dynamically from xml file. Everything goes fine, select is created properly but ddSlick plugin doesn’t see those options fields. I’m 100% sure that they’re have all necessary data values.

Also, it seems that ddSlick is running before my script (even if it is chained AFTER my script) because when I put my options in static way (not by parsing xml but just putting it directly into HTML document) everything goes fine. Here’s my code:

HTML before running my xml2html js function:

<form>
  <select id='countries' name='countries'>
  </select>
</form>

HTML after xml parsing:

<form>
  <select id='countries' name='countries'>
    <option data-imagesrc="css/images/flags/Select...jpg" data-description="Select.." value="0">Select..</option>
    <option data-imagesrc="css/images/flags/United States.jpg" data-description="United States" value="1">United States</option>
    <option data-imagesrc="css/images/flags/United Kingdom.jpg" data-description="United Kingdom" value="2">United Kingdom</option>
    <option data-imagesrc="css/images/flags/France.jpg" data-description="France" value="3">France</option>
  </select>
</form>

HTML after ddSlick run:

<form>
  <div id="countries" class="dd-container" style="width: 260px;">
    <div class="dd-select" style="width: 260px; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial;">
      <input class="dd-selected-value" type="hidden">
      <a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span>
    </div>
    <ul class="dd-options" style="width: 260px;"></ul>
    <option data-imagesrc="css/images/flags/Select...jpg" data-description="Select.." value="0">Select..</option>
    <option data-imagesrc="css/images/flags/United States.jpg" data-description="United States" value="1">United States</option>
    <option data-imagesrc="css/images/flags/United Kingdom.jpg" data-description="United Kingdom" value="2">United Kingdom</option>
    <option data-imagesrc="css/images/flags/France.jpg" data-description="France" value="3">France</option>
    <option data-imagesrc="css/images/flags/Germany.jpg" data-description="Germany" value="4">Germany</option>
    <option data-imagesrc="css/images/flags/Netherlands.jpg" data-description="Netherlands" value="5">Netherlands</option>
  </div>
</form>

Also, I notice an error in browser console: Uncaught TypeError: Cannot read property 'imageSrc' of undefined in line 246 (uncompressed version of ddSlick plugin).

I was trying to run those functions (my xml parsing and ddSlick) as a chain, in one or in two separate <script></script> blocks but without success. I hope I described everything properly. Please help!

  • 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-15T14:09:05+00:00Added an answer on June 15, 2026 at 2:09 pm

    I can reproduce your code with getting Uncaught TypeError you described. It happens when you apply plugin on empty select (check console in fiddle). Your problem is that AJAX call is asynchronous and .ddslick plugin is called earlier that XML is getting loaded. So to fix your code you’ll need to change:

    xml2html();
    $('select').ddslick();
    

    To something like this:

    function xml2html() {
        $.ajax({
            url: 'test.xml',
            dataType: 'xml',
            success: function() {
                // ... process xml - create <option>
                $('select').ddslick();
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a coding problem for those that like this kind of thing. Let's see
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is the problem that I am trying to solve. I have two folders
Here is the problem I'm trying to solve for my game. I have this
Here's the code I have. It works. The only problem is that the first
Here is what I am trying to achieve in PHP: I have this string:
Here is another spoj problem that asks how to find the number of distinct
Here's my problem: I am using a DLL library (not from the .NET framework)
Here is the code in a function I'm trying to revise. This example works

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.