Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $('.report_add').click(function() {
- this_id= this.attr("id");
- $.ajax({
- type: 'POST',
- data: 'reportid'+this_id+'=&userid=789',
- success: function() { ... },
- error: function(){ ... },
- url: '/url/',
- cache:false
- });
- });
- });
- this_id= this.attr("id");
- data: 'reportid'+this_id+'=&userid=789',
- var this_id= this.id;
- data: 'reportid='+this_id+'&userid=789',
- var this_id= $(this).attr("id"); // add a jQuery wrapper
- data: 'reportid='+this_id+'&userid=789',
- data: 'reportid'+this_id+'=&userid=789',
- //-------------^----------^--------------your '=' sign is at wrong place
- data: 'reportid='+this_id+'&userid=789',
- data: {reportid : this_id, userid : 789},
- $(function() {
- $('.report_add').click(function() {
- var this_id= this.id; // <---------update this
- $.ajax({
- type: 'POST',
- data: {reportid : this_id, userid : 789}, // <---- and this
- success: function() { ... },
- error: function(){ ... },
- url: '/url/',
- cache:false
- });
- });
- });
- $(function() {
- $('.report_add').click(function() {
- this_id= $(this).attr("id");
- $.ajax({
- type: 'POST',
- data: 'reportid'+this_id+'&userid=789',
- success: function() {
- $(this).text('Remove From Favourite');
- },
- error: function(){ ... },
- url: '/url/',
- cache:false
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement