Can we redirect using javascript

12 posts, 0 answers
  1. Kanika
    Kanika avatar
    3 posts
    Member since:
    Apr 2013

    Posted 09 Apr 2013 Link to this post

    Hi Guys,
    I am going to use Icenium for my hybrid application, I am a newbie here so just wanted to know if we can redirect through javascript to other pages? My index.html will have lots of options for users and coding all the functions in a single index.html will be complex.. so is there any idea how can i do this?

    Thanks in Advance
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Apr 2013 Link to this post

    Hello Kanika,

    You can use hyperlink:

    <a href="index2.html">Index2</a>

    or window.open, for more info here.

    Generally your question is not directly related to Icenium (which is basically the environment you would work in) and you can get more thorough feedback about such general questions in community forums like StackOverFlow.

    Greetings,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  3. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Apr 2013 Link to this post

    Hi,

    In case you referred to maintaining views in separate files during development, you might want to check the Kendo UI remote views.

    Regards,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  4. Kanika
    Kanika avatar
    3 posts
    Member since:
    Apr 2013

    Posted 09 Apr 2013 Link to this post

    Hi Steve, thanks for your reply but i read somewhere in your forum that if we use window.location.href or hyperlink then Apple might disapprove our application, is it true?

    Thanks
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Apr 2013 Link to this post

    Hi Kanika,

    You can always use window.open if you think/read that other methods might have any drawback.

    Kind regards,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  6. emmapabale
    emmapabale avatar
    12 posts
    Member since:
    Jun 2013

    Posted 25 Jun 2013 Link to this post

    window.open opens a new window. it doesn't show it on the phone simulator.
  7. Kristian D. Dimitrov
    Admin
    Kristian D. Dimitrov avatar
    68 posts

    Posted 28 Jun 2013 Link to this post

    Hi Emma,

     Yes, window.open opens another window. Could you please provide us some more information about your issue:

    1. Which Icenium client are you using Graphite or Mist ?
    2. What is the Cordova version of the project?
    3. Which device and OS Version of the Simulator you use?

    Regards,
    Kristian D. Dimitrov
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  8. Joey Navarro
    Joey Navarro avatar
    16 posts
    Member since:
    Aug 2008

    Posted 14 Nov 2013 Link to this post

    Redirect does not work.
    I created a blank project and added the line
    <a href='www.google.com' target='_blank'>Google</a>

    In Android, when I click on the link, I get the message:
    Application Error
    There was a network error. (file:///android_asset/www/www.google.com)

    In iOS, the link doesn't do anything.
  9. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 Nov 2013 Link to this post

    Hi Joey,

    Cordova uses file:// protocol and you should not omit http:// when you specify URLs.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  10. Joey Navarro
    Joey Navarro avatar
    16 posts
    Member since:
    Aug 2008

    Posted 15 Nov 2013 Link to this post

    I added the http:// to the link but it still doesn't redirect to a new browser window.
  11. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 18 Nov 2013 Link to this post

    Hi Joey,

    I've attached a sample project based on the blank template as you explained. This project works properly on both Android and iOS on our end. Please compare the differences on your end and let us know if further help is needed.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  12. Audrey
    Audrey avatar
    52 posts
    Member since:
    Jan 2013

    Posted 18 Nov 2013 Link to this post

    To redirect in a page which is in the project use :
    window.location = "page2.html";
Back to Top