TeeChart HTML5 getting data from remote XML file - html

I have a lokal HTML file using teechart HTML 5 (testing it) , and would like to get the Data from a remote server , is it possible ?
I am trying to do something like this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Graf</title>
</head>
<!--[if lt IE 9]>
<script src="./js/excanvas/excanvas_text.js"></script>
<script src="./js/excanvas/canvas.text.js"></script>
<![endif]-->
<script src="./js/teechart.js" type="text/javascript">
</script>
<script src="./js/teechart-extras.js" type="text/javascript"></script>
<script src="./js/teechart-table.js"></script>
<script language="JavaScript">
<!--
function draw() {
var Chart1=new Tee.Chart("canvas");
var b=Chart1.addSeries(new Tee.Bar());
b.loadXML("http://www.myserver.com/xml/graf.xml");
Chart1.draw();
}
//-->
</script>
<BODY onload="draw()">
<canvas id="canvas" width="1000" height="400"></canvas>
</html>
The graph is drawn but the content in graf.xml is not shown , is it possible ?
graf.xml:
<series name="Friends" color="Blue" metric="Quantity">
<point name="Facebook" value="123"/>
<point name="Twitter" value="456"/>
<point name="Google+" value="789"/>
</series>

I've made a simple example getting an xml from the same server:
http://www.steema.com/files/public/teechart/html5/latest/demos/sources/FromXMLURL.htm

Related

How does Postman get data from a response, which is not JSON or XML?

<html>
<head>
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="style.css" type=text/css rel=stylesheet>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="position.js"></script>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="copyright.js"></script>
<!--[if lt IE 7.]
<script defer type="text/javascript" src="pngfix.js"></script>
<LINK href="style2.css" type=text/css rel=stylesheet>
[endif]-->
</head>
<script>
var session_key='09fcf555eb2814024ee22e47cacfb04e';
//get user power
var NOWPATH = get_now_url();
var user_power="0";
if ( NOWPATH == "/" )
NOWPATH = document.location.pathname.substring(1,document.location.pathname.length);
/* get page url*/
function goto_home()
{
if(user_power == '0') //Admin
goto_page("quicksetup.asp",0);
else //User
goto_page("wan_sub_u.asp",0);
}
</script>
<body></body>
</html>
As is above, it is a HTML response, I would like to get the variable "session_key" value from the HTML text. But I don't know how to do it with Postman.
Try something like this in tests:
var sessionKey = responseBody.match('var session_key=\'([a-zA-Z0-9]+)\'')[1];
postman.setEnvironmentVariable("session_key", sessionKey);
And then look in environment variables for a value and reuse where it needed.

Less file not working with html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Coming Soon</title>
<meta name="description" content="" />
<meta name="author" content="" />
<!--mobile specific meta-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<!-- css goes here -->
<link rel="stylesheet/less" href="styles.less">
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.1/less.min.js"></script>
<script> less = { env: "development", async: false, fileAsync: true }; </script>
<!--[if lt ie 9]-->
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<!--[endif]-->
<!--Js-->
<script src="https://code.jquery.com/jquery-latest.js"></script>
<script src="Js/countdown.js"></script>
<script>
<!--less javascript-->
<script src="http://lesscss.googlecode.com/files/less-1.3.0.min.js" type="text/javascript"></script>
<!-- live reload -->
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
</head>
</body>
</html>
This is the code in my html, my less file doesnt change no matter what code i use, im using espresso and livereload to compile my code, i have also changed the language so i can edit the less file in espresso while using the css highlights etc.
I've tried so many things and as im new to web Design and coding this is quite hard for me, im trying to build a coming soon page which im nearly done with but all these problems keep coming up.

Phonegap app - json + php - crossdomain not working

i have a problem with the phonegap app.
I try to connect with ajax post with simple php file which return my an array in my app.
This is simple example/tutorial from net. I try everything i read a tousends of topics, but i don't know where is problem.
My index of the phonegap app
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Minimal AppLaud App</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
<script type="text/javascript" charset="utf-8">
function connect(e)
{
var term= {button:e};
$.ajax({
url:'http://domain.pl/replay.php',
type:'POST',
data:term,
dataType:'json',
error:function(jqXHR,text_status,strError){
alert('no connection');},
timeout:6000,
success:function(data){
$("#result").html("");
for(var i in data){
$("#result").append("<li>"+data[i]+"</li>");
}
}
});}
</script>
</head>
<body id="stage" class="theme">
<center><b>Bikes or Cars</b></center>
<center><input onclick="connect(this.value)" type="button" value="cars" /></center>
<center><input onclick="connect(this.value)" type="button" value="bikes" /></center>
<center><b>Results</b></center>
<ul id="result"></ul>
</body>
</html>
And my replay.php file
<?php
$choice =$_POST["button"];
$cars = array("Honde", "BMW" , "Ferrari");
$bikes = array("Ducaite", "Royal Enfield" , "Harley Davidson");
if($choice == "cars") print json_encode($cars);
else print json_encode($bikes);
?>
I add domain whitelist to cordova and config xml files
<access origin=".*"/>
And i don't have any ideas what is wrong.
Thanks in advance for any suggestions.
Replace
<access origin=".*"/>
with
<access origin="*"/>
Maybe it will solve a problem.

Incorporating External Html into a jQuery Mobile page

I am attempting to dynamically incorporate an external source of html into a jQuery mobile page. I am able to successfully incorporate the external html but it looks like regular HTML (i.e. not jQuery mobile affected Html). Can any one suggest what I might be doing wrong?
Main Html:
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css"
/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://jqueryui.com/ui/jquery-1.7.1.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
<script>
$(document).ready(function () {
$("#main").load('externalHtml.html');
//$("#main").append('externalHtml.html');
//$("#main").load('externalHtml.html #contain');
//$("#main").page();
});
</script>
</head>
<body>
<div data-role="content">
<div id="main"></div>Main Page</div>
</body>
externalHtml.html:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css"/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://jqueryui.com/ui/jquery-1.7.1.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
</head>
<body>
external html
<div data-role="content" id="contain">
<input type="search" name="name" id="name" value="" />
</div>
</body>
</html>
If you .trigger('create') on the container element, jQuery Mobile will automatically initialize any widget within the container. For example:
$("#main").load('externalHtml.html').trigger('create');
They really should document this better, but if you look at the API events for each type of widget, you will see the documentation regarding the create event.
Also, read the top of this page of the documentation: http://jquerymobile.com/demos/1.1.1/docs/api/events.html
You should not be using document.ready and instead should be binding to the pageinit event for pseudo-pages. Using document.ready will most likely create headaches for you in the future.
-- UPDATE --
You will probably want to call .trigger('create') in a callback so the external HTML has loaded before you attempt to initialize it:
$("#main").load('externalHtml.html', function () {
$(this).trigger('create');
});

SAP UI5: object expected error in IE

i am using SAP UI5 and don't know why is it showing object expected in line 347 while running index.html file in ie.
<html>
<head>
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<script src="resources/sap-ui-core.js"
type="text/javascript"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.ui.ux3"
data-sap-ui-theme="sap_goldreflection" >
</script>
<script type="text/javascript" src="OPM_CM.js"></script>
<script>
sap.ui.localResources("opm");
var view = sap.ui.view({id:"OPM_CM1", viewName:"opm.OPM_CM", type:sap.ui.core.mvc.ViewType.JS});
//view.placeAt("content");
buildShell();
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
thanks in advance.
This may be happening because the sap object is not available.
<script>
function init(){
sap.ui.localResources("opm");
var view = sap.ui.view({id:"OPM_CM1", viewName:"opm.OPM_CM", type:sap.ui.core.mvc.ViewType.JS});
//view.placeAt("content");
buildShell();
}
window.addEventListener('load',init);
</script>
adding your code to a function and calling it on body onload may do the trick.
Note: please also give more details about the error you are getting.