javascript - Post form to web2py function using ajax -


the server written in web2py, , hosted on google app engine. can visit index.html entering domain.com/index , can send form entering domain.com/register "register" function defined default.py

however, in html, send form server , response, use ajax has cross domain issues. use "register" url, , not work. help?

$("#signup").click(function() { $.ajax({        type: "post",        url: "register",        data: $("#formsignup").serialize(), // serializes form's elements.        success: function(data)        {            alert(data);        }      });  return false; // avoid execute actual submit of form. }); 

by typing domain.com/register, can totally trigger function. problem here? , form sent domain.com... in browser appears htt[://domain.com/?email=ada@ad.com&password=adsa

its possible register looking instead of post try changing type in ajax

$("#signup").click(function() { $.ajax({        type: "get",        url: "register",        data: $("#formsignup").serialize(), // serializes form's elements.        success: function(data)        {            alert(data);        }      });  return false; // avoid execute actual submit of form. }); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -