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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:47:38+00:00 2026-06-17T20:47:38+00:00

I will like to have the same functionality found in here: http://jsfiddle.net/jhruh/2/ on my

  • 0

I will like to have the same functionality found in here: http://jsfiddle.net/jhruh/2/ on my website.

I don’t understand why if I copy all the things I do not get the same functionality. The steps I have done are:

  1. Copied the HTML
  2. Added the jquery library ( <script src="http://code.jquery.com/jquery-1.8.3.js"></script> in the head of the html I copied on step 1
  3. added a script tag as the last child of the body tag containing the jsFiddler code.
  4. Added the jquery $(function(){}) on top of JavaScript code.

In other words I now have:

<!DOCTYPE html>
<html>
<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width" />

    <!-- Step 2 -->
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
    <div data-role="page" id="index">
        <div data-role="header">
            <h1>
                XML Parsing demo</h1>
        </div>
        <div data-role="content">
            <ul data-role="listview" data-inset="true" id="cars-data">
            </ul>
        </div>
    </div>
    <div data-role="page" id="cars">
        <div data-role="header">
            <a data-role="button" data-transition="none" data-theme="a" href="#index">Back</a>
            <h1>
            </h1>
        </div>
        <div data-role="content">
            <ul data-role="listview" data-inset="true" id="car-data">
            </ul>
            <img src="" width="100%" style="height: auto;" id="car-img" />
        </div>
    </div>

    <!-- Step 3 -->
    <script>

        // <!-- Step 4 // do stuff after DOM has loaded -->
        $(function () {

            $('#index').live('pagebeforeshow', function (e, data) {
                $('#cars-data').empty();
                $.ajax({
                    type: "POST",
                    url: "InvalidUrlCreatedOnPurpose",
                    dataType: "xml",
                    data: {
                        xml: "<cars><car><name>TOYOTA</name><country>JAPAN</country><pic>http://1call.ms/Websites/schwartz2012/images/toyota-rav4.jpg</pic><description>Toyota has announced that it will recall a total of 778,000 units that may have been manufactured with improperly-tightened nuts on the rear suspension.</description></car></cars>"
                    },
                    success: function (xml) {


                        var xmlstr = (new XMLSerializer()).serializeToString(xml);
                        alert(xmlstr);

                        alert(xml);
                        ajax.parseXML(xml);

                    },
                    error: function (request, error) {
                        alert('Remember to remove this message once it works!');
                        var x = "<cars><car><name>TOYOTA</name><country>JAPAN</country><pic>http://1call.ms/Websites/schwartz2012/images/toyota-rav4.jpg</pic><description>Toyota has announced that it will recall a total of 778,000 units that may have been manufactured with improperly-tightened nuts on the rear suspension.</description></car></cars>";
                        ajax.parseXML(x);
                    }
                });
            });

            $("#cars").live('pagebeforeshow', function () {
                $("#cars div[data-role='header'] h1").html(carObject.carName);
                $('#car-data').empty();
                $('#car-data').append('<li>Car Type:<span> ' + carObject.carName + '</span></li>');
                $('#car-data').append('<li>Car Country:<span> ' + carObject.carCountry + '</span></li>');
                $('#car-data').append('<li>Car Description:<span> ' + carObject.description + '</span></li>');
                $('#car-data').listview('refresh');
                $('#car-img').attr('src', carObject.img);

            });

            var ajax = {
                parseXML: function (result) {
                    $(result).find("car").each(function () {
                        carObject.carName = $(this).find('name').text();
                        carObject.carCountry = $(this).find('country').text();
                        carObject.img = $(this).find('pic').text();
                        carObject.description = $(this).find('description').text();

                        $('#cars-data').append('<li><a href="#cars"><img src="' + carObject.img + '" title="sample" height="100%" width="100%"/><h3>Car type:<span> ' + carObject.carName + '</span></h3><p>' + carObject.description + '</p></a></li>');
                    });
                    $('#cars-data').listview('refresh');
                    $('#index').append('<div data-role="footer" data-position="fixed"><h1>Dynamicaly added footer</h1></div> ');
                    $('#index [data-role="content"]').append('<fieldset data-role="controlgroup"><legend>Choose:</legend><input type="radio" name="radio" id="radio1" value="1" checked="checked" /><label for="radio1">option 1</label></fieldset>');
                    $('#index').trigger('pagecreate');
                }
            }

            var carObject = {
                carName: '',
                carCountry: '',
                img: '',
                description: ''
            }

        });

    </script>
</body>
</html>

The page behaves different why? I know that jsFiddler can simulate an ajax call using the url ‘echo’ but I simulated an error on purpose hoping I could get the same results on my website.

Edit

I changed the image source for: http://cdn1.iconfinder.com/data/icons/sleekxp/Google%20Chrome.png

I updated jsFiddler the new link is: http://jsfiddle.net/jhruh/3/ and I canot make it work still.

  • 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-17T20:47:40+00:00Added an answer on June 17, 2026 at 8:47 pm

    Line 33, Column 74: Bad value for attribute src on element img: Must be non-empty.

    Syntax of IRI reference:
    Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.

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

Sidebar

Related Questions

so I have a div which will include an image http://www.reversl.net/hovers/ and I'd like
I am developing mobile apps using phonegap. My mobile app will have same functionality
I will like to know: I have a scenario. If a user adds a
I have created an Activity that will behave like a popup menu is actually
I'd like to have a commit message cleanup that will not necessarily remove lines
I have a PHP file which will return something like <div id=title>Add Us On
I will have to perform a spelling check-like operation in Python as follows: I
The typical Python threadpool will have a structure like this one: def run(self): while
I'd like to implement a ListView that will have a list of SelectedItems as
I have a windows form simply like this: 1) a button when clicked will

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.