Srikanth Yadake
Srikanth Yadake

Reputation: 573

Need help, in displaying a value of javascript function

Check this code

function readvalue() {
var WshShell = new ActiveXObject("WScript.Shell");

var value = WshShell.RegRead("HKLM\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
write("<text class="
name ">");
write(value);
write("</text>");
}

http://jsfiddle.net/SrikanthYadake/2E5rE/2/

I am unable to present the text in variable "value" inside the blue box.

Please help.

Upvotes: 0

Views: 85

Answers (2)

Chirag Vidani
Chirag Vidani

Reputation: 2587

Try with below code

function readvalue() {
    var WshShell = new ActiveXObject("WScript.Shell");

    var value = WshShell.RegRead("HKLM\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
    document.write("<text class='name'>" + value+"</text>" );
}

Fiddle updated

Upvotes: 1

Code Lღver
Code Lღver

Reputation: 15593

check the below code:

write("<text class="
name ">");
write(value);
write("</text>");

It have some error. so replace with:

write("<text class='name'>");
write(value);
write("</text>");

Upvotes: 0

Related Questions