Im trying go access one html page from another.All my html pages hosted in server. My index page is loading without issue. But when trying other pages, I get following error,
XMLHttpRequest cannot load http://localhost:8080/cache/getSite?clientName=bps. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8080' is therefore not allowed access.
Im accessing from the browser like;
http://127.0.0.1:8080/
//for index.htmlhttp://127.0.0.1:8080/doc/clientSiteinfo.html?client=bps //for other pages linked with index.html
I generated my index page with the links for other pages like;
> function loadCustomers(configFile) { $
> .ajax({
> type : 'GET',
> url : configFile.server + ':8080/cache/getCustomers',
> dataType : 'json',
> success : function(data) {
> var rows = [];
> $
> .each(
> data,
> function(id, value) {
> rows
> .push(' <tr><td><a href="'+configFile.server+':8080/doc/clientSiteinfo.html?client='
> + id
> + '">'
> + id
> + '</td><td>'
> + value
> + '</td><td><button type="button" onclick="resetClient(\''
> + id+','+configFile.server
> + '\')">Reset</td></tr> ');
> });
> $('#clients_data').append(
> '<tbody>' + rows.join('') + '</tbody>');
> $('#clients_data').DataTable({
> "pagingType" : "full_numbers"
> });
>
> }
> }); };