jquery ajax plugin  multiple options

Posted on 2012-08-31
Last Modified: 2012-09-01
The following plugin fails, however, succeeds when I change the data to only the PeId name value pair.
How do I code multiplename-value paris involving options?
An example of two or even three name value pairs in the data would be helpful

Here is the code

$.fn.qbeexecSearch = function (options) {

      var defaults = {
             url: 'TSRIQBEF/jx/jxdefault.asp',
             destination: '#targ',
             getparam:  "this=that"
       }; //default options
       var retval = "";
      //inherit from provided configuration (if any)
      var options = $.extend(defaults, options);
            case "search":
                        type: "POST",
                        url: options.url,
                        data: { 'PeId' : options.strPeId ; 'PeName' : options.strPeName},
                        success: function(data,extStatus,jqXHR){

                        complete:  function(){
                        var pagecount = Number($('#SearchResults').attr("reccount")) / 10
                        alert("line 40 " + pagecount);
                        $('#recordcountliteral').html("Record 1 of " + $('#SearchResults').attr("reccount"));
                        error: function(request,status,error){
                              alert("An error has occurred.  Ref: qbe_plugin.js Line 40.  Error: " = request.responseText);                                                
Question by:KeithMcElroy
    1 Comment
    LVL 50

    Accepted Solution

    Separate with commas not semi-colons and your key values don't need quotes so

      data: { PeId : options.strPeId,  PeName : options.strPeName},

    Open in new window

    Try that

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now