This is a follow up to my previous question (unresolved).
I fetch items from the database and display them in a for loop. I use jQuery to hide one of the rows. Now I need to get the main_id of that hidden row and pass it to $.ajax. In the original question Paul suggested to use alert(this.attr("title")); but this line stops the execution of the $.ajax call and the call is not executed. When I comment out the alert alert(this.attr("title")); then the ajax call goes through. In that case, I get an error because the display_false() function in the handler does not get the value of the main_id.
This is the html of the "hide" link with title=%s.
<a class="false" title=%s href="/useradminpage?main_id=%s&display=false"><span class="small">(hide)</span></a>
So I need to pass the value of the main_id stored in alert(this.attr("title")); to the function display_false() when the ajax call is executed.
How can I do this?
The relevant code is below:
The Script
self.response.out.write("""
<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
<title>User Admin Page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
alert("1 - document ready is called")
$("a.false").click(function(e) {
$(this).closest("tr.hide").hide("slow");
e.preventDefault();
alert("2 - row is hidden")
});
$("a.false").click(function() {
alert("3 - ajax")
//the following ale