JQuery SmartWizard: Dynamic ajax content

2.8k Views Asked by At

I'm using JQuery SmartWizard and it has the ability to load content using Ajax, but I do not see how to pass any parameters to the server. Am I missing something?

It seems like the purpose of having Ajax is to send parameters to the server, and get back different content depending on input parameters, right? I only see a step_number parameter, but I don't know how or if that can be altered, since there are a static number of steps. Thanks.

2

There are 2 best solutions below

3
On BEST ANSWER

you pass variables to the server using the url. file.php?do=nothing&name=john&relaxmode=on

function getdata(url,id,lastseen)
    {
    $.ajax(url+’?userid=’+id+’&lastvisit=’+lastseen).done(function(data)
        {
        if(data.indexOf(’alive’)!=-1)alert(’he is alive’)
        })
   }
0
On

You can make change to ajaxurl in function leaveAStepCallback. you can place one hiddenfield and can assign modified ajaxurl in this hidden field. in wizard js file we should modify that url call to get value from hidden field value of ajaxurl.

i.e before ajax call

if ($("#ajaxUrl").val() != "") {
                               ajaxurl = $("#ajaxUrl").val()
                           }