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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:09:12+00:00 2026-06-01T03:09:12+00:00

I am using PhoneGap, jQuery mobile in Xcode. I have a local xml (data.xml)

  • 0

I am using PhoneGap, jQuery mobile in Xcode. I have a local xml (data.xml) file with the following data

<?xml version="1.0" encoding="utf-8" ?>
<RecentTutorials>
<Tutorial author="The Reddest">
    <Title>Silverlight and the Netflix API</Title>
    <Categories>
        <Category>Tutorials</Category>
        <Category>Silverlight 2.0</Category>
        <Category>Silverlight</Category>
        <Category>C#</Category>
        <Category>XAML</Category>
    </Categories>
    <Date>1/13/2009</Date>
</Tutorial>
<Tutorial author="The Hairiest">
    <Title>Cake PHP 4 - Saving and Validating Data</Title>
    <Categories>
        <Category>Tutorials</Category>
        <Category>CakePHP</Category>
        <Category>PHP</Category>
    </Categories>
    <Date>1/12/2009</Date>
</Tutorial>
<Tutorial author="The Tallest">
    <Title>Silverlight 2 - Using initParams</Title>
    <Categories>
        <Category>Tutorials</Category>
        <Category>Silverlight 2.0</Category>
        <Category>Silverlight</Category>
        <Category>C#</Category>
        <Category>HTML</Category>
    </Categories>
    <Date>1/6/2009</Date>
</Tutorial>
<Tutorial author="The Fattest">
    <Title>Controlling iTunes with AutoHotkey</Title>
    <Categories>
        <Category>Tutorials</Category>
        <Category>AutoHotkey</Category>
    </Categories>
    <Date>12/12/2008</Date>
</Tutorial>

And I have the following code in my html file:

<script type="text/javascript">
            $(document).ready(function()
            {
            $.ajax({
            type: "GET",
            url: "data.xml",
            dataType: "xml",
                   success: function(xml){
                   $(xml).find("Tutorial").each(function()
                                                {

                                $("#output").append($(this).attr("author") + "<br />");
                                                });


                   }
            });
            });

            </script>


            <script type="text/javascript">
                function parseXml(xml)
                {

                    $(xml).find("Tutorial").each(function()
                                                 {
                                                 $("#output").append($(this).attr("author") + "<br />");
                                                 });


                }    
            </script>


</head> 

<body> 
    <div data-role="page">

        <div data-role="header" data-position="fixed">
            <h1>The title</h1>
        </div><!-- /header -->

        <div data-role="content" id="output">

  <--!  XML DATA SUPPOSED TO BE DISPLAYED HERE BUT I GOT NOTHING HERE  -->

        </div><!-- /content -->

        <div data-role="footer" data-position="fixed">
            <h4>The Footer</h4>
        </div><!-- /header -->
    </div><!-- /page -->
</body>

I am using Xcode for the output in the iPhone simulator and its not displaying anything inside the content which is supposed to be displayed.

Where did I do mistake or do I need third-party xml parser ?

Any suggestions would be a great help.
Thanks

  • 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-01T03:09:14+00:00Added an answer on June 1, 2026 at 3:09 am

    I have found the solution for this and it worked perfectly for me.
    Instead of using

    $(document).ready(function() {
    
    });
    

    I wrote the following:

    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    
    <script>
    $(document).bind("mobileinit", function() {
    
    // AJAX code goes here
    
    });
    <script>
    
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-
    1.0.min.js"></script>
    

    Its important to note that this code should be between the jquery-core and jquery-mobile link as I did above.

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

Sidebar

Related Questions

I am using jQuery Mobile for my PhoneGap app in Xcode. I have created
I am developing a Android app using Jquery Mobile/Phonegap. I have the following code
I am using the following technologies: - jQuery Mobile 1.0.1 - Phonegap 1.3.0 -
I am using android 2.2, phonegap 1.3, and jquery-mobile 1.0 I have a list
I am developing a mobile application using phonegap and jquery mobile. I have this
I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I have a mobile web application built using the following versions :- JQuery Mobile
I am using phonegap + jquery mobile and have a submit function that works
I'm using phonegap 1.1.0 and jquery mobile rc1. The following code works as expected
I have some strange scrolling problems with my PhoneGap (using jQuery Mobile) app: I'm

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.