Solved

post from jquery to php and return value to display on html page

Posted on 2010-11-17
2
640 Views
Last Modified: 2012-05-10
Hello,

I think I know how to post to php (see below), but how do I return a value from my php script to the client in order to display it on the html page?


$.post("deleteImage.php", {imageId:albumId});
0
Comment
Question by:cgray1223
  • 2
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 34159831
Check here the syntax : http://api.jquery.com/jQuery.post/

You miss the success function :

$.post("deleteImage.php", {"imageId":albumId},function(data) {
    alert(data); // alert the data for testing purpose
}
);
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34161383
Thanks for the points!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question