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

How to get the data from ajax request in servlet page. Here I'm calling
I am calling a .txt file from a jquery ajax call. It has some
I have an ajax request that looks like this, $(#frmProducts).submit(function(){ var dataSet = $(#frmProducts).serialize();
I'm making paypal request using Ajax calling but I'm getting error with status ZERO.The
i am trying to return value from ajax request to a function on form
Calling Validate() on an XmlDocument requires passing in a ValidationEventHandler delegate. That event function
When calling php via cli, the current directory is NOT changed to the one
when calling a SSIS package (C# app) using LoadFromSqlServer, does the user account have
When calling the ImagePicker to take a picture the user is not prompted to
I have a simple ajax request that I am trying to call a web

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.