Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

How to find an element from a jQuery AJAX response with jQuery .find() method

Posted on June 13, 2021 by Habibie

If you are a jQuery luver, you must know how to use jQuery Post and Date functions.

Recently I’ve been working on a project, that involves this jQuery Get thingy like this:

$.get("somedirectory/somefile.html", function(data){
   var whatineed = $(data).find("#someelement").html();
   console.log(whatineed);
});

But, unfortunately it did not work. If you are facing the same case as me, try to wrap that data variable parsed from jQuery Get with some div tag, like this:

var whatineed = $("<div>" + data + "</div>").find("#someelement").html();

I tried it and it worked.

Post Views: 205
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
  • Advanced Blinking Marker Script to show objects position in your game canvas
  • Ciihuy Images Merger – Fast & Easy Online Image Combiner
© 2025 ThirteeNov | Powered by Superbs Personal Blog theme