in Education by
I am pulling information from a Page note from the Facebook API. In the output I get an image URL embeded in HTML code. How can I extract the image url from the HTML code below using Javascript? \ UPDATE The above image tag is embedded in the JSON-response from the Facebook API. I am also using Appcelerator to create an iOS app. UPDATE 2 I solved it with: json.data[i].message.match(/src=(.+?[\.jpg|\.gif|\.png]")/)[1] Thankful for all help! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use jQuery to extract any data from html. Use the following code $(function() { $('img').attr("src"); }); This will return you the src value only for the first instance of the img tag. If you want a specific img tag, you can include it inside a div.

Related questions

0 votes
    I am pulling information from a Page note from the Facebook API. In the output I get an image URL ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following is used to extract data from HTML code of websites? (a) Webscraping (b) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
0 votes
    When does JavaScript code appear inline within an HTML file? (a) Between the script tag (b) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
0 votes
    Choose the correct JavaScript syntax to change the content of the following HTML code.

asked Feb 27, 2021 in Technology by JackTerrance

0 votes
    What is the HTML tag under which one can write the JavaScript code? A) B) C)
    Is it possible to remove ( not hide using display:none ) some part of HTML from source for mobile ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    Displays image from the indicated url is ____ No unrelated answers…It’s very important plzz… Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    If my post duplicated, please give me references. because i failed finding post that appropriate from my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I am trying to use MVC model to create "update news" page. News has an image and i am using ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    Which side of the image map can be created using JavaScript? (a) Server side (b) Client side (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    I would like to ask if I require a Mac for the entire process of the iPhone app development or ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
...