Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- November 4, 2009 at 4:08 pm #7773antmaryParticipant
TestOnServer.jsee:
/* Test On Server script by antmary@126.com
4th, Jun 2009 */
var root_dir = "d:www";
/* web server root directory */
var server_baseurl = "http://localhost";
/* server url to root */
var root_regex = new RegExp("^"+root_dir.replace("","\"),"i");
var file_path = document.FullName;
if (!document.saved) {
alert("Please save the document first!");
} else if (!root_regex.test(file_path)) {
alert("File is not in the root directory!");
} else {
var url = server_baseurl + file_path.replace(root_regex, "").replace(//gi,"/");
OpenBrowser(url);
}
function OpenBrowser(url) {
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run(url);
}
i hope it helps :lol:
November 5, 2009 at 3:43 am #7776ToadLoadinMemberIt’s really helpful, and very inovative. :-)
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.