Instead of ActiveXobject what i have to use for Chrome or FF.
Below code is not working on Chrome and FF.
i am getting the below error
"Uncaught ReferenceError: ActiveXObject is not defined".
<!DOCTYPE html>
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/vlc-2.2.4-win64.exe", 1, false);
}
</script>
</head>
<body>
<input type="button" value="Run Notepad" onclick="RunFile();"/>
</body>
</html>
There is no cross-browser way to trigger the execution of applications on the user's system from an HTML document.
Related
I know that
<a href = 'ymsgr:sendim?contactID'>Send me a message</a>
will launch Yahoo Messenger.
can I create something like this to launch MSWord or my own application?
Here is an explanation of what you're describing: https://stackoverflow.com/a/16586294/4500419
And here you can find the URI specifications for Microsoft Office:
https://msdn.microsoft.com/en-us/library/office/dn906146.aspx#sectionSection4
So, something like
ms-word:ofv|u|http://yoursite.com/document.docx
Would open document.docx in read-only mode in MS Word.
And here's the doc on how to register your own application to a URI scheme in Windows:
https://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
This works also by simply naming the html file .hta which is fine if its for a local project
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp" APPLICATIONNAME="Application Executer" BORDER="no" CAPTION="no" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" SCROLL="no" WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("c:/windows/system32/notepad.exe", 1, false); }
</script>
</head>
<body>
<input type="button" value="Run Notepad" onclick="RunFile();"/>
</body>
</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
I'm trying to do a simple APP with Phonegap (cordova 3.0.0) on iOS. Here is my index.html:
<!DOCTYPE html>
<head>
<title>APP</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
alert("Hello!");
}
</script>
</head>
<body onload="onLoad()">
HOLA
<br />
PULSAME
<div id="idi"></div>
</body>
</html>
But nothing happens. My device never is ready, never shows the alert. I think the problem is the cordova.js, but I can't find the problem (the proyect was created fine and runs).
Any help?
Don't use your onLoad function to attach the listener. Instead just attach the listener, then use your onDeviceReady function as if it is the onLoad. It should look like this:
<!DOCTYPE html>
<head>
<title>SmartPol</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert("Hello!");
}
</script>
</head>
<body>
HOLA
<br />
PULSAME
<div id="idi"></div>
</body>
</html>
Also, if you want to attach any other event listeners then you can do so after onDeviceReady has fired.
Being new to Dojo I'm trying to initialize a Dijit form with values, e.g. read from storage, XHR etc.
However, invoking form.setFormValues() causes an error TypeError: invalid 'in' operand this.formWidgets thrown by http://yandex.st/dojo/1.7.3/dojox//form/manager/_Mixin.js
Is there anything I'm doing wrong or is this a Dojo issue? (The complete sample is also found here: http://pastebin.com/7LUHr3iA)
<!-- language-all: lang-html -->
`
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.3/dijit/themes/claro/claro.css" media="screen">
<script type="text/javascript">
dojoConfig = {async: true,parseOnLoad: true};
</script>
<script type="text/javascript" src="http://yandex.st/dojo/1.7.3/dojo/dojo.js"></script>
<script type="text/javascript">
require(["dijit/form/TextBox","dijit/form/Button","dojox/form/Manager",
"dojo/parser","dojo/dom","dijit/registry"], function () {});
</script>
</head>
<body class="claro">
<form id="myForm" method="post" data-dojo-type="dojox.form.Manager">
<label for="name">Name</label>
<input id="name" name="nameField" data-dojo-type="dijit.form.TextBox"/><br/>
<label for="surname">Surname</label>
<input id="surname" name="surnameField" data-dojo-type="dijit.form.TextBox"/><br/>
<button data-dojo-type="dijit.form.Button">Submit</button>
<script type="dojo/method" event="startup">
var form = dijit.byId("myForm");
form.setFormValues({
nameField: "Hello",
surnameField: "World"
});
</script>
</form>
</body>
</html>
`
Dojo 1.7 is asynchronous. Code should take the form:
require(["dependency"], function(dep) {
// use dependency
});
There is no reason to believe dojox/form/Manager would be loaded when you try to reference it further down the page.
The registry is the correct way to reference the widget, not 1.6 style code of the form dijit.byId. See livedocs.
See also the dojo/domReady! plugin.
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.