Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django template in views.py

def post_note(request,id):
    post_id = request.GET['note']
    print(post_id)
    //sql insertion code,once its done i want to notify to the front end..print some alert message.
    return render(request, './profile.html')
Comment

django template in views.py

$('#tn1').click(function(){
          var msg='';
          alert('inside alert');
          if ($('textarea#message') != "") {
            var message = $('#notesarea').val();
            alert(message);
            msg=message;
          }


          $.ajax({
        url: 'post_note',
        data: {
          'note': msg
        },

        success: function (data) {
          alert(data)
        }
      });
Comment

PREVIOUS NEXT
Code Example
Python :: neat way to print 2d array 
Python :: python TypeError: function takes positional arguments but were given 
Python :: explain the use of return keyword python 
Python :: double for loop in list comprehension 
Python :: remove key from dictionary python 
Python :: how to iterate row wise using 2d integer array in python 
Python :: plot dataframe 
Python :: how to overlap two barplots in seaborn 
Python :: python - merge and incluse only specific columns 
Python :: if in python 
Python :: __str__ returned non-string (type User) 
Python :: discord bot python 
Python :: como instalar python en ubuntu 20.04 
Python :: logger 
Python :: speech enhancement techniques 
Python :: how to split a string by colon in python 
Python :: creating a dictionary 
Python :: replace nan in pandas column with mode and printing it 
Python :: initialize empty dictionary python 
Python :: pandas get size of each group 
Python :: django url with slug 
Python :: summing all Odd Numbers from 1 to N 
Python :: cosine similarity numpy 
Python :: Reverse an string Using Reversed function 
Python :: bitbucket rest api python example 
Python :: python rounding numbers to n digits 
Python :: python module search 
Python :: write hexadecimal in python 
Python :: python print new line 
Python :: densenet python keras 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =