We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,973 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

runApp() link works in IE, not in Chrome or Firefox

I have a lab management webapp that lists servers on my network. With a click in IE I can open a terminal services session to that server.

The code - shown below - works in IE, but not in chrome or firefox. Can anyone suggest how I can make this work in Chrome (Firefox would be nice too, but Chrome is more important.)

I fooled around with an idea to do it with jquery, but couldn't make it work. I do have jquery loaded, though.

<span style="color:blue;cursor:hand;" onClick="runApp('mstsc /v 10.1.2.3'); return false;" title="Click to open Terminal Services session">HOSTNAME</span>

Would appreciate any advice. This has crippled an otherwise very useful tool.

2
Contributors
3
Replies
1 Day
Discussion Span
3 Months Ago
Last Updated
5
Views
scaiferw
Junior Poster
115 posts since May 2010
Reputation Points: 25
Solved Threads: 7
Skill Endorsements: 0

@scaiferw

The code - shown below - works in IE, but not in chrome or firefox. Can anyone suggest how I can make this work in Chrome (Firefox would be nice too, but Chrome is more important.)

Can you post your code regarding with runApp() function.

LastMitch
Industrious Poster
4,155 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45

The runApp() code is in my original post above.

The alternative I've been looking at is a jquery setup where the HTML code is:

<span class="tsconnect" device_ip="10.1.2.3" style="color:blue;cursor:hand;" title="Click to open a Terminal Services session">[LBPDMPKW01]</span>

and the javascript code is;

$(document).ready(function() {
  $(".tsconnect").click(function () {
    alert("hello");
    //  runApp($(this).data("device_ip"));
    //  alert($(this).data("device_ip"));
    //  runApp("ping -t 127.0.0.1");
    //  runApp("mstsc /v 10.1.2.3"); return false;
    //  runApp("c:\temp\temp.cmd"); return false;
  });
}); 

I can't get any of the commented runapp() or alert() lines to run, though I know the function is firing because the uncommented alert("hello"); line works whenever I click on the spanned text.

scaiferw
Junior Poster
115 posts since May 2010
Reputation Points: 25
Solved Threads: 7
Skill Endorsements: 0

I can't get any of the commented runapp() or alert() lines to run, though I know the function is firing because the uncommented alert("hello"); line works whenever I click on the spanned text

Instead of click()

$(".tsconnect").click(function () 

Try using on() function:

$(document).ready(function() {
$("tsconnect").on("click",function(){
alert("hello");
runApp($(this).data("device_ip"));
alert($(this).data("device_ip"));
runApp("ping -t 127.0.0.1");
runApp("mstsc /v 10.1.2.3"); return false;
runApp("c:\temp\temp.cmd"); return false;
});
}); 

I'm not sure it's gonna work because this doesn't look right inside of runApp() & alert():

$(this).data("device_ip")
ping -t 127.0.0.1
mstsc /v 10.1.2.3
c:\temp\temp.cmd

Try to put 3 alerts and see how it goes. Put like one word in each alert.
If all 3 alerts appear then there's something wrong with

$(this).data("device_ip")
ping -t 127.0.0.1
mstsc /v 10.1.2.3
c:\temp\temp.cmd

So there's nothing wrong with the function runApp() & alert()

You need to find another way to make it readable so that runApp() & alert() function can read it and work.

LastMitch
Industrious Poster
4,155 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0707 seconds using 2.76MB