Probably you are facing the 'same-origin policy' (it's even in
Wikipedia: http://en.wikipedia.org/wiki/Same_origin_policy), you can't
read data from a server in a different domain than that which served the
HTML page. If it just a test setup, move things around. If the
production environment is going to be like that, you might want to take
a look at YUI's get utility.
Satyam
info2hussain wrote:
> Hi,
>
> I am new to javascript and YUI. To develop my application, I need to
> to fetch data from remote server and shown in the browser. The
> incoming data are JSON data. I have one server in my laptop which is
> generating data and I want to fetch the data from there and shown in
> my browser for the test reason. When ever I try to run my html file, I
> can see the DataTable with column name in the browser but now data
> rather it shows 'Loading Data...' but it never loads. I get the
> following message in firebug 'Access to restricted URI denied" code:
> "1012' If any one can help me in solving my problem then I will really
> appreciate it. I have pasted the whole code below:
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
> <title>Untitled Document</title>
>
> <!--CSS file (default YUI Sam Skin) -->
> <link type="text/css" rel="stylesheet"
> href="http://yui.yahooapis.com/2.5.2/build/datatable/assets/skins/sam/datatable.css">
>
>
> <!-- Dependencies -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script>
>
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script>
>
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/datasource/datasource-beta-min.js"></script>
>
>
> <!-- OPTIONAL: JSON Utility -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/json/json-min.js"></script>
>
> <!-- OPTIONAL: Connection (enables XHR) -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/connection/connection-min.js"></script>
>
>
> <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns)
> -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/dragdrop/dragdrop-min.js"></script>
>
>
> <!-- OPTIONAL: Calendar (enables calendar editors) -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/calendar/calendar-min.js"></script>
>
>
> <!-- Source files -->
> <script type="text/javascript"
> src="http://yui.yahooapis.com/2.5.2/build/datatable/datatable-beta-min.js"></script>
>
>
> <script>
>
> function showProcessList(){
>
>
>
> var myColumnDefs = [
> {key:"name",sortable:true, label:"Name"},
> {key:"values",sortable:true, label:"Values"},
>
> ];
>
> var myDataSource= new
> YAHOO.util.DataSource("http://localhost:8080/api-javascript/instance?ontology=EXECUTION-HISTORY&instance=http%3A%2F%2Fwww.ip-super.org%2Fontologies%2Fexecution-history%23event33f8ea90b9c3?");
>
> myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
> myDataSource.connXhrMode = "queueRequests";
> myDataSource.responseSchema = {
> resultsList : 'slots',
> fields: ["name","values"]
> };
>
>
> var myDataTable = new YAHOO.widget.DataTable("myContainer",
> myColumnDefs, myDataSource);
>
> }
>
>
> </script>
> </head>
> <body class="yui-skin-sam" onload="showProcessList()">
> <div id="myContainer"></div>
> </body>
> </html>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>