Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5peditor-init.js file getAjaxUrl method is missing the ? for query parameters #47

Open
MiikaL opened this issue Mar 9, 2018 · 2 comments

Comments

@MiikaL
Copy link

MiikaL commented Mar 9, 2018

In the file h5peditor-init.js, with the method getAjaxUrl where is constructs the query url, I think its missing the addition of the "?" to make it a valid url.

I would change this:
if (parameters !== undefined) { for (var property in parameters) { if (parameters.hasOwnProperty(property)) { url += '&' + property + '=' + parameters[property]; } } }

to this:
if (parameters !== undefined) { var separator = '?'; for (var property in parameters) { if (parameters.hasOwnProperty(property)) { url += separator + property + '=' + parameters[property]; separator = '&'; } } }

@icc
Copy link
Member

icc commented Mar 22, 2018

Could you create a Pull Request for this?
Also, note that the ? may already be in the ajaxPath, so you may want to do a
ajaxPath.indexOf('?') === -1 ? '?' : '&'

@MiikaL
Copy link
Author

MiikaL commented Mar 27, 2018

I made the pull request here: #51

Hopefully I got it right, was my first pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants