This is a migrated thread and some comments may be shown as answers.

Using the romote view to shown a file on antoher server

1 Answer 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 27 Mar 2012, 08:04 PM
HI i am looking at the exemple called view. This example shows how to call a remote file (remote vieew) from a path called ../../content/mobile/view/remoteview.html. I would like to call this or another at a server with a http adress. I have tryed to just copy the remote view file to a another server but i does not load the "Hi I'm a remote view. I would like to call some pages on a server and have them presented in the design (inside the div) so that it looks like it is a part of the app and not showing the browser. Is this not what this is for also?

This is this code i am using.
It just ads #http://iapp.timeplan.dk/remoteview.html to the adress
Thanks
Lars

<!DOCTYPE html>
<html>
<head>
    <title>Overview</title>
    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.mobile.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet" />
    <link href="../../../styles/kendo.mobile.all.min.css" rel="stylesheet" />
</head>
<body>
    <a href="../index.html">Back</a>
    <div data-role="view" data-title="Views">
    <header data-role="header">
        <div data-role="navbar">
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
        </div>
    </header>
    <ul data-role="listview" data-style="inset">
        <li><a href="#secondview">Local View</a></li>
    </ul>
    <ul data-role="listview" data-style="inset">
        <li><a href="http://iapp.timeplan.dk/remoteview.html">Remote View</a></li>
    </ul>
</div>

<div data-role="view" id="secondview" data-layout="mobile-view" data-title="Local View">
    <p>Hello world!</p>
</div>

<div data-role="layout" data-id="mobile-view">
    <header data-role="header">
        <div data-role="navbar">
            <a class="nav-button" data-align="left" data-role="backbutton">Back</a>
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
        </div>
    </header>
</div>

    <script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
    </script>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 28 Mar 2012, 11:57 AM
Hello Lars,

You are experiencing this problem, because Ajax has a same origin policy and does not work cross-domain. If you insist to achieve that, you may use the Cross-Origin Resource Sharing.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Lars
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or