Djm
Djm

Reputation: 55

Doing Ajax calls from jQuery with mocking

I want to make an ajax call in jquery which will bring a picture and texts on the side (actually it is a profile picture and little info about that particular person).And have a link underneath that picture.But i dont know what data type to use in $.ajax()?And where do i put the link in html?Also i am mocking the data so i dont know in what file to put the picture and text.Thank you in advance.

Upvotes: 1

Views: 240

Answers (1)

justkt
justkt

Reputation: 14766

If you don't need to do any special processing, consider using .load, which wraps .ajax and loads HTML into a specified container into your page. Your server side mock script should expose HTML which provides the picture and text, hardcoded, from a database, or what have you.

The below assumes your side area where you want to load these items contains a div with the id of sideContainer.

$("#sideContainer").load("/path/to/mock/as/html/");

Upvotes: 2

Related Questions