irigsoft Posted December 11, 2021 Share Posted December 11, 2021 19 minutes ago, Frederick said: The problem is not specified to any payment gateway. If I call a URL address like https://www.somedomain.com/?userID=fred&password=mypass, I want the parameters to be hidden (this is achieved by Sherzod's JS code) and I want this URL address to appear in place of my application. Ok, now I understand the problem. Thank You. Quote Link to comment Share on other sites More sharing options...
likemike Posted December 12, 2021 Share Posted December 12, 2021 In HTML I use: <script> function updateURL() { if (history.pushState) { var newurl = window.location.protocol + "//myurl.com"; window.history.pushState({path:newurl},'',newurl); } } </script> and in the "body"-part: <body onload="updateURL();"> This always shows only your URL ("myurl.com"). 1 Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 13, 2021 Share Posted December 13, 2021 How do I implement the above in a button click with parameter passing of hidden variables? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2021 Share Posted December 13, 2021 2 hours ago, Frederick said: How do I implement the above in a button click with parameter passing of hidden variables? Maybe this will help: https://reqbin.com/req/javascript/uzf79ewc/javascript-post-request-example I have used this to communicate from my uniGui application (in Browser) to other Android application (server) on device. Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 13, 2021 Share Posted December 13, 2021 5 hours ago, irigsoft said: Maybe this will help: https://reqbin.com/req/javascript/uzf79ewc/javascript-post-request-example I have used this to communicate from my uniGui application (in Browser) to other Android application (server) on device. I do have the JS code to pass hidden variables as provided by Sherzod and it works fine. It is just that, the URL it calls is shown in a separate tab. I think that it is not doable since Sherzod has not provided a solution. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2021 Share Posted December 13, 2021 30 minutes ago, Frederick said: I think that it is not doable since Sherzod has not provided a solution. Yes, by security reasons. My last example (the link above) shows the execution of code and parameters without changing the url, only that. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2021 Share Posted December 13, 2021 On 12/12/2021 at 12:51 PM, likemike said: In HTML I use: <script> function updateURL() { if (history.pushState) { var newurl = window.location.protocol + "//myurl.com"; window.history.pushState({path:newurl},'',newurl); } } </script> and in the "body"-part: <body onload="updateURL();"> This always shows only your URL ("myurl.com"). Hello, Can You try to apply this example with "url = https://google.com", did You will get same Ajax Error ? Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 13, 2021 Share Posted December 13, 2021 11 minutes ago, irigsoft said: Yes, by security reasons. My last example (the link above) shows the execution of code and parameters without changing the url, only that. Noted, thanks. Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 13, 2021 Share Posted December 13, 2021 6 minutes ago, irigsoft said: Hello, Can You try to apply this example with "url = https://google.com", did You will get same Ajax Error ? Yes, I get an Ajax error. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2021 Share Posted December 13, 2021 2 minutes ago, Frederick said: Yes, I get an Ajax error. I am sorry, question was to @likemike Quote Link to comment Share on other sites More sharing options...
likemike Posted December 13, 2021 Share Posted December 13, 2021 37 minutes ago, irigsoft said: I am sorry, question was to @likemike Hi! I'm confused. I don't get any Ajax error. I've only tried to find a solution to make parameters invisible in the URL. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted December 13, 2021 Share Posted December 13, 2021 54 minutes ago, likemike said: Hi! I'm confused. I don't get any Ajax error. I've only tried to find a solution to make parameters invisible in the URL. Hello, Can You try to apply Your example with "url = https://google.com", did You will get same Ajax Error ? Quote Link to comment Share on other sites More sharing options...
likemike Posted December 13, 2021 Share Posted December 13, 2021 My example is only suitable to protect the URL of your own webpage! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.