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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:40:18+00:00 2026-05-14T19:40:18+00:00

an extension of my last question, getDate with Jquery Datepicker , I am trying

  • 0

an extension of my last question, getDate with Jquery Datepicker ,

I am trying to use the jquery datepicker to load specific info from xml file dependent on the date selected by the user. Similar code but i am trying to load and parse an xml file to read contents of the file for the particular date.

In a perfect world the user would tap a date and below the datepicker html output would give the user specific times for the selected date instead of my last project of an image.

my probelm is nothing is loading, so my question is what am i doing wrong?

my code is as follows

<!DOCTYPE html>

    <link type="text/css" href="css/ui-darkness/jquery-ui-1.8.custom.css" rel="stylesheet" />   
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
    <script type="text/javascript">
        $(function(){
            // Datepicker
            $('#datepicker').datepicker({
                dateFormat: 'yy-mm-dd',
                inline: true,
                minDate: new Date(2010, 1 - 1, 1),
                maxDate:new Date(2010, 12 - 1, 31),
                altField: '#datepicker_value',
                onSelect: function(){
                    var day1 = $("#datepicker").datepicker('getDate').getDate();                 
                    var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1;             
                    var year1 = $("#datepicker").datepicker('getDate').getFullYear();
                    var fullDate = year1 + "" + month1 + "" + day1;
                    //var str_output ="<img src=\"http://website/images/a" + fullDate +".png\" width=\"100%\"/>";
                    //"<h1>"+fullDate+"</h1>";
                    //"<img src=\"http://website/images/a" + fullDate +".png\"/>";
                    //$('#page_output').html(str_output);
                        var doc = loadXMLDoc('date.xml'); // loading the XML file
                        var el = doc.getElementsByTagName('_'+date); // retrieving the elements corrsponding to a date, eg: _20100103
                        var page_output = document.getElementById('page_output');   

                        if(el.length >= 1)
                        {
                            // matched XML data found for the specified date    
                            var dt = el[0].getElementsByTagName('date');
                            var great_times = el[0].getElementsByTagName('great_times');
                            var good_times = el[0].getElementsByTagName('good_times');      
                            var str_output = "<h1><center>" + dt[0].childNodes[0].nodeValue + "</center></h1><br/><br>";
                            str_output += "<b>Excellent Times:</b><br> " + great_times[0].childNodes[0].nodeValue + "<br/><br>";
                            str_output += "<b>Good Times:</b><br> " + good_times[0].childNodes[0].nodeValue + "<br/><br>";
                            $('#page_output').html(str_output);// writing the results to the div element (page_out)
                        }
                        else
                        {
                            alert("Sorry","Action not allowed on this page");
                            page_output.innerHTML = ''; // No XML data found for the selected date
                            reloadmainwDate();      
                            return false;
                        }   
                        return true;    
                }
            });             
            //hover states on the static widgets
            $('#dialog_link, ul#icons li').hover(
                function() { $(this).addClass('ui-state-hover'); }, 
                function() { $(this).removeClass('ui-state-hover'); }
            );          
        });
        //var img_date = .datepicker('getDate');
            //var day1 = $("#datepicker").datepicker('getDate').getDate();               
            //var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1;               
            //var year1 = $("#datepicker").datepicker('getDate').getFullYear();
            //var fullDate = year1 + "-" + month1 + "-" + day1;
            //var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
            //var str_output = "<h1><center><p>"+ date + "</p></center></h1>";
            //$('#page_output')[0].innerHTML = str_output;



    // writing the results to the div element (page_out)
    </script>
    <script>

function loadXMLDoc(dname)
{
var xmlDoc;

// IE 5 and IE 6
if(typeof ActiveXObject != 'undefined') 
{   
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlDoc.load(dname);
    return xmlDoc;
}
else if (window.XMLHttpRequest) // firefox
{
    xmlDoc=new window.XMLHttpRequest();
    xmlDoc.open("GET",dname,false);
    xmlDoc.send("");
    return xmlDoc.responseXML;
}
alert("Error loading document");
return null;

}

    <!-- Datepicker -->

    <div id="datepicker"></div>

    <!-- Highlight / Error -->

    <div id="page_output"></div>


</body>

  • 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-14T19:40:19+00:00Added an answer on May 14, 2026 at 7:40 pm

    corrected my code not very long ago, i am just going to answer my own question in case anyone has similar problems.

    <!DOCTYPE html>
    

        <link type="text/css" href="css/ui-darkness/jquery-ui-1.8.custom.css" rel="stylesheet" />   
        <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
        <script type="text/javascript">
            $(function(){
                // Datepicker
                $('#datepicker').datepicker({
                    dateFormat: 'yy-mm-dd',
                    inline: true,
                    minDate: new Date(2010, 1 - 1, 1),
                    maxDate:new Date(2010, 12 - 1, 31),
                    altField: '#datepicker_value',
                    onSelect: function(){
                        var day1 = $("#datepicker").datepicker('getDate').getDate();                 
                        var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1;             
                        var year1 = $("#datepicker").datepicker('getDate').getFullYear();
                        // code added  
                        // this is to convert the month '3' to '03'
                        month1 = addZero(month1, 2);
                        day1 = addZero(day1, 2);
                        var fullDate = year1 + month1 + day1;
    
                        parseXML(fullDate);//move function outside of this function
                        //var str_output ="<img src=\"http://69.*.*.*/images/a" + fullDate +".png\" width=\"100%\"/>";
                        //"<h1>"+fullDate+"</h1>";
                        //"<img src=\"http://69.*.*.*/images/a" + fullDate +".png\"/>";
                        //$('#page_output').html(str_output);
    
                    }
                });             
                //hover states on the static widgets
                $('#dialog_link, ul#icons li').hover(
                    function() { $(this).addClass('ui-state-hover'); }, 
                    function() { $(this).removeClass('ui-state-hover'); }
                );          
            });
            //var img_date = .datepicker('getDate');
                //var day1 = $("#datepicker").datepicker('getDate').getDate();               
                //var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1;               
                //var year1 = $("#datepicker").datepicker('getDate').getFullYear();
                //var fullDate = year1 + month1 + day1;
                //var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
                //var str_output = "<h1><center><p>"+ date + "</p></center></h1>";
                //$('#page_output')[0].innerHTML = str_output;
    
    
    
        // writing the results to the div element (page_out)
        </script>
        <script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've spent last couple of hours trying to add the Memcache extension to my
Alright, so this is an extension to a question I asked last night. I
Hey guys, quick question, just trying to filter a user's first and last name
I was trying to develop a Chrome extension that can display me the last
ffmpeg extension is loaded as it is shown at phpinfo(), my file and script
The extension methods: Response.AsJson Response.AsXml works fine when calling it from the constractor like:
Take the following demo code (from the GIO answer to this question), which uses
I modified the extension method Thorarin gave in response to this question to work
This is related to another question I asked last week, but the current issue
I am writing a Google Chrome Extension and trying to make the transition to

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.