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

  • Home
  • SEARCH
  • 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 6358861
In Process

The Archive Base Latest Questions

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

I am calling an Ajax request with jQuery: $.get(url, function(data){ $(data).find(‘ul’); }); And here

  • 0

I am calling an Ajax request with jQuery:

$.get(url, function(data){
    $(data).find('ul');
});

And here is a problem – it does not find any ul.

Returned HTML code looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
    <title>Title</title>
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
    <meta name="description" content="Mobilna wersja serwisu GoldenLine." />
    <meta name="keywords" content="praca, networking, forum, blog, bran?a" />
    <link rel="stylesheet" type="text/css" href="http://css.goldenline.pl/mobile.css" />
    <link rel="shortcut icon" href="http://x/favicon.ico" />
</head>
<body>
    <h1><a id="h" href="http://x/"><img src="http://x/img/mobile.gif" alt="GoldenLine" /></a></h1>
    <h2>Moje grupy</h2>
    <ul>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/estimating-software">estimating software</a>
        </li>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/google-hacking">Google hacking</a>
        </li>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/google-plus">Google Plus</a>
        </li>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/praca-dla-informatykow">IT – Praca dla osób z...</a>
        </li>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/jezyki-skryptowe">Języki Skryptowe</a>
        </li>
        <li>
            <img src="http://x/img/ico-post.png" alt="" />
            <a href="http://x/forum/netcamp">Netcamp</a>
        </li>
    </ul>
    <p class="setAsRead"><a href="http://x/fora/ozn">Ozn</a></p>
    <form method="get" action="http://x/szukaj">
        <input type="text" name="q" />
        <input type="submit" value="Szukaj" />
    </form>
    <ul>
        <li>1. <img src="http://x/img/msg_box_ico.gif" alt="" /> <a href="http://x/skrzynka" accesskey="1">Skrzynka [0]</a></li>
        <li>2. <a href="http://x/kontakty" accesskey="2">Kontakty</a></li>
        <li>3. <a href="http://x/forum" accesskey="3">Moje grupy</a></li>
        <li>4. <a href="http://x/wylogowanie" accesskey="4">Wyloguj</a></li>
    </ul>
    <div class="footer">
        <p>2010 &copy; Goldenline.pl | <a href="http://x/www">przejdź do normalnej wersji serwisu</a></p>
    </div>
</body>
</html>

But when I convert it into an object

$(data)

I got something like this:

[
<!--?xml version="1.0" encoding="UTF-8"?-->, 
Text, 
<title>?GoldenLine.pl?</title>?, 
Text, 
<meta http-equiv=?"content-type" content=?"application/?xhtml+xml;? charset=utf-8">?, 
Text, 
<meta name=?"description" content=?"Mobilna wersja serwisu GoldenLine.">?, 
Text, 
<meta name=?"keywords" content=?"praca, networking, forum, blog, bran?a">?, 
Text, 
<link rel=?"stylesheet" type=?"text/?css" href=?"http:?/?/?css.goldenline.pl/?mobile.css">?, 
Text, 
<link rel=?"shortcut icon" href=?"http:?/?/?m.goldenline.pl/?favicon.ico">?, 
Text, 
<h1>?…?</h1>?, 
Text, 
<h2>?Moje grupy?</h2>?, 
Text, 
<ul>?…?</ul>?, 
Text, 
<p class=?"setAsRead">?…?</p>?, 
Text, 
<form method=?"get" action=?"http:?/?/?m.goldenline.pl/?szukaj">?…?</form>?, 
Text, 
<ul>?…?</ul>?, 
Text, 
<div class=?"footer">?…?</div>?, 
Text, 
<script type=?"text/?javascript">?…?</script>?, 
Text
]

What should I do to match <ul> elements in this piece of code returned from Ajax request ?

  • 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-24T23:26:35+00:00Added an answer on May 24, 2026 at 11:26 pm

    i think you should first insert returned html data in one html element.

    var mytag=$('<div></div>').html(data);
    

    now using jQuery you can extract all ul nodes.

    $('ul',mytag);
    

    it will return array of all ul tags.

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

Sidebar

Related Questions

All, I have a Jquery ajax request calling out a URL. The ajax response
I am calling a function that returns the result of an ajax GET request
Using the following JQuery/AJAX function I'm calling a partial view when an option is
I am calling a service that return JSON data. Script: $.ajax({ type: "POST", url:
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I've got a quite strange problem here. I'm calling some simple code via Ajax.Updater:
Using jQuery's $.ajax() function. Wherether the request has been purposely aborted, or if the
I got problem with two AJAX calls. I'm calling it from a jquery object.
I have written some code using jQuery to use Ajax to get data from
Calling the ajax called URL works well without ajax eg. http://localhost/ci/controller/method/param_value . But using

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.