Execute the notepad data using querystring [modified]
-
I am using querystring to execute the notepad data. notepad contains follwing: mailto:shail?CC=shail&Subject=test&Body=qtsts I dont want to use window.open script in notepad file to open the prepopulated outlook window, is there anyway we can open the outlook window using above 'mailto:' data. Below is url as example http:example.com?name=http:teamspace/sites/notepadefile.txt below is my script <script> function PageQuery(q) { if(q.length > 1) this.q = q.substring(1, q.length); else this.q = null; this.keyValuePairs = new Array(); if(q) { for(var i=0; i < this.q.split("&").length; i++) { this.keyValuePairs[i] = this.q.split("&")[i]; } } this.getKeyValuePairs = function() { return this.keyValuePairs; } this.getValue = function(s) { for(var j=0; j < this.keyValuePairs.length; j++) { if(this.keyValuePairs[j].split("=")[0] == s) return this.keyValuePairs[j].split("=")[1]; } return false; } this.getParameters = function() { var a = new Array(this.getLength()); for(var j=0; j < this.keyValuePairs.length; j++) { a[j] = this.keyValuePairs[j].split("=")[0]; } return a; } this.getLength = function() { return this.keyValuePairs.length; } } function queryString(key){ var page = new PageQuery(window.location.search); return unescape(page.getValue(key)); } function displayItem(key){ if(queryString(key)=='false') { document.write("you didn't enter a ?name=value querystring item."); }else{ document.write(queryString(key)); } } </script>
modified on Thursday, August 12, 2010 8:38 AM
-
I am using querystring to execute the notepad data. notepad contains follwing: mailto:shail?CC=shail&Subject=test&Body=qtsts I dont want to use window.open script in notepad file to open the prepopulated outlook window, is there anyway we can open the outlook window using above 'mailto:' data. Below is url as example http:example.com?name=http:teamspace/sites/notepadefile.txt below is my script <script> function PageQuery(q) { if(q.length > 1) this.q = q.substring(1, q.length); else this.q = null; this.keyValuePairs = new Array(); if(q) { for(var i=0; i < this.q.split("&").length; i++) { this.keyValuePairs[i] = this.q.split("&")[i]; } } this.getKeyValuePairs = function() { return this.keyValuePairs; } this.getValue = function(s) { for(var j=0; j < this.keyValuePairs.length; j++) { if(this.keyValuePairs[j].split("=")[0] == s) return this.keyValuePairs[j].split("=")[1]; } return false; } this.getParameters = function() { var a = new Array(this.getLength()); for(var j=0; j < this.keyValuePairs.length; j++) { a[j] = this.keyValuePairs[j].split("=")[0]; } return a; } this.getLength = function() { return this.keyValuePairs.length; } } function queryString(key){ var page = new PageQuery(window.location.search); return unescape(page.getValue(key)); } function displayItem(key){ if(queryString(key)=='false') { document.write("you didn't enter a ?name=value querystring item."); }else{ document.write(queryString(key)); } } </script>
modified on Thursday, August 12, 2010 8:38 AM
shailrathore wrote:
I am using querystring to read the notepad data. notepad contains follwing mailto:shail?CC=shail&Subject=test&Body=qtsts
What does it means? You are reading nodepad data in querystring??
shailrathore wrote:
I dont want to use window.open script in notepade file, is there anyway we can open the outlook window using above 'mailto:' data. at the moment it only write the data. http:example.com?name=http:teamspace/sites/notepadefile.txt below is my script
Your question is not clear. If I understand correctly that you wants to read the data from a text file and prepare the mail body, subject etc and send the email. Is it right?
-
shailrathore wrote:
I am using querystring to read the notepad data. notepad contains follwing mailto:shail?CC=shail&Subject=test&Body=qtsts
What does it means? You are reading nodepad data in querystring??
shailrathore wrote:
I dont want to use window.open script in notepade file, is there anyway we can open the outlook window using above 'mailto:' data. at the moment it only write the data. http:example.com?name=http:teamspace/sites/notepadefile.txt below is my script
Your question is not clear. If I understand correctly that you wants to read the data from a text file and prepare the mail body, subject etc and send the email. Is it right?
Yes Prosanta you are right. At the moment I am using below script in notepad window.open('mailto:shail?CC=shail&Subject=test&Body=qtsts ') and i dont what to use this script. Please help Shail