javascript - Direct a value to another page jquery? -


I'm new to jquery. I know that this is just a simple way to create a jquery function. But there is an error in my code, if someone can help me then I would be very grateful for that.

What do I have: I have a table with two buttons for editing each record and one for removing a record.

What I am trying to do:
When I click on the button, I will have to direct with the record id to the second page where I have my database The PHP query is for manipulating records.

My table looks like this: Enter image details here

This is my html code:

  & lt; Tr id = "& lt;? Php echo $ row ['id'];? & Gt;" & gt; & Lt; Td> & Lt ;? Php echo $ inc; ? & Gt; & Lt; / TD & gt; & Lt; Td> & Lt ;? Php echo $ line ['name']; ? & Gt; & Lt; / TD & gt; & Lt; Td> & Lt ;? Php echo $ row ['father_name']; ? & Gt; & Lt; / TD & gt; & Lt; Td> & Lt ;? Php echo $ row ['email']; ? & Gt; & Lt; / TD & gt; & Lt; Td> & Lt ;? Php echo $ line ['contact']; ? & Gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt ;? Php echo "& lt; button class = 'btn' value = ''. $ Line ['id']. "'Onclick =' update (this.value) '& gt; Edit & lt; / button & gt; ? & Gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt ;? Php echo "button class = 'btn' value = ''. $ Line ['id']. '' Onclick = 'delete (this.value)' & gt; Delete ?     This is my Jquery code:   
  Delete function (str) {$ ('delete.php? Q =' str +);}  


I know something is wrong but I do not know I would also appreciate the suggestion for learning.

Use the AJAX request for it

Delete function (value) {$ .ajax ({data: {'q': value}, then Answer: 'POST', url: 'delele.php', success: function (xhr) {Console.log ("record dellet");}}}

}


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -