Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7880389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:08:03+00:00 2026-06-03T04:08:03+00:00

I am building data for an ajax call. I am using jquery. my function(simplified)

  • 0

I am building data for an ajax call. I am using jquery.

my function(simplified) is below.
I would like to use the jquery serialize() on vname and vemail, but it seems like you can only do this on form vars. is there a way to do this with normal vars or do i need to do something else to make these vars safe for the ajax call?

Thanks

function sendEmailNotify(vname, vemail, docID){
       $.ajax({
           type: "POST",
           url: "/servlet/trainingServlet",
           data: ({method: 'ajaxEmailNotify',vname: vname , vemail: vemail }),
           dataType: 'json',
           success: function(data){
               if ( data.success != "OK" ){
                   alert(data.message);
               }
           }
       });

   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:08:04+00:00Added an answer on June 3, 2026 at 4:08 am

    The jQuery .serialize() function can be called on a jQuery object that contains one or more forms, or a jQuery object that contains a specific set of individual form input elements, and will return a URL parameter string with all of those values.

    If vname and vemail in your code refer to input elements, then you can create a jQuery object containing those, then call .serialize(). If, however, they are simply values, then you don’t need to do anything else with them.

    As a semi-related note, you don’t need the parentheses around the object you’re passing to the data property – I have no idea if having that will cause problems, but since they serve no purpose in being there you may as well remove them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a Monotouch application which downloads data from the server encrypted using
I am building an app with complex data which I use arrays for. Some
I'm building an ASP.NET MVC site where I want to implement jQuery AJAX calls
Im building a codeigniter app which uses json_encode to provide ajax data in many
Building decent RIA data-intensive crud-like application is still hard. In spite of existence tons
I'm building a select list with an Ajax call that is triggered when another
I am building nested comments. My AJAX script gets a list of comments like
I'm building an AJAX based portfolio module using pushState / hash bangs and as
I'm using ajax to retrieve some data from the backend. I get the result
I'm building a simple aggregator-type app that would pull in data from multiple websites

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.