Parsing returned HTML from jQuery AJAX request

Your code works fine. You just aren’t using jsFiddle’s API correctly. Check the docs for /echo/html/ (

URL: /echo/html/

Data has to be provided via POST

So, you need to update your AJAX call to use POST. Also the trailing slash is needed.

$(function () {
        url: "/echo/html/",
        type: "post",
        dataType: "html",
        success: function (data) {
        data: {
            html: '<!DOCTYPE html><head><title><\/title><link href="../css/popup.css" rel="stylesheet" /><\/head><body><ul><li><a id="link">content<\/a><\/li><\/ul><\/body><\/html>'


Leave a Comment