Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Get the ID using javascript/jquery Re: Get the ID using javascript/jquery

#59394
asp
Participant

Well now I have made this script:

Code:
$(function(){
$(“.index”).click(function () {
//var to send, the id of the other div
var id = element.attr(“id”);
//if the div is hidden do your thing
if ($(“#info_inner”).is(“:hidden”)) {
$.ajax({
type: “POST”,
//post to proses page
url: “/stuff/Fil_save/prosess.php”,
data: id,
//div fades in when operation is a success
success: function(){
$(“#info_inner”).fadeIn(“fast”);
}
});
}
else {
$(“#info_inner”).fadeOut(“fast”);
return false;
}
});
});

Is this right?

And to display the div should I include the prosess.php page on the index page? That’s what I don’t understand. I understand how to send the id to the page, and how to implement it in the php but not how to get the information back to the index.php. :?