top.location.href doesn't send the full URL
Hey
I want to write a function which reads out an entered URL from a input field and sends this URL as query string to the next site.
Here is my jQuery Code:
- $(document).ready(function() {
- $("#myform").on('submit',(function() {
- var url = $("#user-url").val();
- url = encodeURIComponent(url);
- top.location.href = "index.php?application.php&url="+url;
- }));
- });
and the HTML Part:
- <form form id="myform">
- <input type="text" id="user-url"/>
- <button type="submit" class="grey">Submit</button>
- </form>
The Script redirects me to the following URL: index.php?
No trace of a query string or the "application.php"-File.
I hope someone can help me
Thanks in advance!