How to open external link and center on page?

4 posts, 0 answers
  1. Basem
    Basem avatar
    27 posts
    Member since:
    Dec 2010

    Posted 30 Jun 2012 Link to this post

    I am trying to use the window widget to open http://google.com for example and display in the center of the page. I tried the code below, but it does not do anything (no errors either). I also tried adding it to an existing element on the page, $('#window'), but displays a blank white window.

    $('<div />').kendoWindow({
      content: 'http://google.com',
      iframe: false,
      modal: true
    }).data('kendoWindow').center();

    I would like to use it similar to how the AJAX RadControl Window is used: http://demos.telerik.com/aspnet-ajax/window/examples/default/defaultcs.aspx

    Any help would be greatly appreciated!
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 02 Jul 2012 Link to this post

    Hello Basem,

    Opening external websites requires an iframe to be used -- the snippet doesn't work because it attempts to make a cross-domain request that is shot down by the browser. Specifying iframe: true should solve the problem.

    All the best,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Basem
    Basem avatar
    27 posts
    Member since:
    Dec 2010

    Posted 02 Jul 2012 Link to this post

    I initially tried this but failed with the error : Refused to display document because display forbidden by X-Frame-Options.

    According to the other forum posts, there is some weird check that is happening in KendoUI so it was told to make iframe: false to get around it. Something definitely seems off. Please take a look at this live example: http://jsfiddle.net/zq5eC/
  5. Basem
    Basem avatar
    27 posts
    Member since:
    Dec 2010

    Posted 02 Jul 2012 Link to this post

    Wait, this seems to be a restriction by Google! It seems they do not allow this for any of their sites including maps. I tried other sites and it works though: http://jsfiddle.net/zq5eC/1/ . Although not a general solution, Google maps particular requires you add &output=embed
    in the URL. I hope this saves others some frustration.
Back to Top
Kendo UI is VS 2017 Ready