miguel-perez / smoothState.js

Unobtrusive page transitions with jQuery.
MIT License
4.43k stars 508 forks source link

Fix submitForm GET method bug #361

Closed Cow258 closed 6 years ago

Cow258 commented 6 years ago

Fixed thing

  1. action attribute may empty when using GET method
  2. method attribute may empty when using GET method
  3. request.data should not repeat again when using GET method

Issue Form tag HTML

<form id="form1" method="get">
    <input id="keyword" name="keyword" type="text" value="test"/>
    <input id="method" name="method" type="text" value="PlanA"/>
    <input id="ok" name="ok" type="submit" value="Submit">
</form>

Old Version

Url will be wrong!
smoothState will be crash!

https://localhost/undefined?keyword=test&ok=Submit&keyword=test&ok=Submit

New Version

Url will be correct!

https://localhost/?keyword=test&method=PlanA&ok=Submit
Cow258 commented 6 years ago

I got another issue, so close this pull request, and open another pull request