Question

I am working with a Sencha Touch 2.2.1 application. In my application, I am using Ajax call to perform an activity. The URL I specified in Ajax request will redirect to some other URL after execution. To complete my process I need to get that URL. I went through almost all questions regarding the topic in stackoverflow. Unfortunately nothing works. I tried getAllResponseHeaders() and some other answers I found in stackoverflow.

I tried to open that Ajax url: value in window.open() function in InAppBrowser. But It Opens a new window. I don't need it. So to solve this problem, that is to get the new URL, I think there are 2 ways.

  1. Any mechanism to return(get) the redirected URL to the Ajax call
  2. Any way to open a hidden InAppBrowser and execute the URL & get the result.

Second way is the best I think, But any helps regarding the topic is appreciated.

Was it helpful?

Solution

OMG !!

Finally I found out it.

To get the Redirected URL I give the URL to an InAppBrowser. My problem was how to open the browser window in hidden mode..!! The latest Cordova docs explains about it. I was referring the old docs. That's why I didn't get the answer. The Solution I found out is this: when open InAppBrowser open it in hidden mode..! That's all..!!

var ref = window.open(authorize_url, '_blank', 'location=no,hidden=yes');

This hidden=yes solved my problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top