http://over100percent.com (房地产经纪人赚取超过100% http :: / hipfsbo.com(对于严肃的家庭卖家或买家来说,这是一个很有用的地方 对新想法持开放态度) 解决方案 1。"<!----- Begin"是一个无效的javascript函数。它应该有 前面的斜杠(比如结尾)。 2. mailto addy中的斜线不应该在那里。 3.向你放置的结尾< \ / a>"而不是< / a> 4.你应该查看 http://msdn.microsoft.com/library/de...ned/mailto.asp 我发现它非常有帮助。 l8r Steve Horrillo写道: 我不明白为什么这个剧本不会在电子邮件中插入主题和为什么我不能控制使用的字体和大小?我不知道在哪里发布这个。如果这是OT,请告诉我。 < SCRIPT LANGUAGE =" JavaScript"> <! - 开始函数isPPC(){ if(navigator.appVersion.indexOf(" PPC")!= -1)返回true; else返回false; } if(isPPC()){ document.write(''< b> Send< A CLASS =" contact" HREF = \" mailto:\?subject \ =看看我找到的网站。?body =你可以在这个网站上看到这个网站 http://www.BrokerAgentTraining.com \" onMouseOver =" window.status = \''发送你的朋友关于这个网站的电子邮件\ ''; return true" TITLE ="发送你的朋友发送电子邮件到这个网站">这个网站< \ / A>给朋友< / b>''); } else {document.write(''< b> Send< A CLASS =" contact" HREF = \" mailto:\?body \ =看看看看这个我找到了一个网站。你可以在 http://www.BrokerAgentTraining上看到这个网站.com\onMouseOver =" window.status = \''发送给您的朋友发送关于这个网站的电子邮件'\\''; 返回真实 TITLE =发送你的朋友关于这个网站的电子邮件>这个网站< \ / A>给朋友< / b>''); } //结束 - > < / script> 你的JavaScript引用了我的朋友的问题。我在使用引号编写带有引号的复杂字符串时的建议是在缓冲区变量中构建字符串 位。调试要容易得多。 var buf =''< b> Send< A CLASS =" contact" HREF =" mailto:?subject =拿一个''; buf + =''查看我发现的网站。& body =你可以看到这个网站''; buf + =''http://www.BrokerAgentTraining.com" onMouseOver =" window.status =''; buf + ="''发送你的朋友关于这个网站的电子邮件''; return true" ;; buf + =''" TITLE =发送你的朋友关于这个网站的电子邮件>这个 网站< / a>给朋友< / b>''; document.write(buf); 此外,mailto链接不可靠,并非所有客户都会填写 的身体... 来自主题的分隔符应该是''&'''不'?'''br /> " mailto:em *** @ bogus.com?subject=Some subject& body =你的正文 最后这是一个JavaScript,而不是Java问题。 - 保重, Jonathan - ----------------- LITTLE WORKS STUDIO http://www.tittleWorksStudio.com Steve Horrillo写道:我可以我们弄清楚为什么这个剧本不会在电子邮件中插入主题和为什么我不能控制使用的字体和大小?我不知道在哪里发布 哪个字体和大小?在电子邮件或页面上?一个''mailto''是 使用body,另一个是主题。这是有意的吗?否则,他们 似乎做了完全相同的事情。 如果你的意思是在电子邮件中,你只有 电子邮件客户端,你不知道那是什么,什么是支持或 ,即使配置了一个。所以你运气好,这个 将会起作用。 我不知道为什么你甚至在测试''PPC''导航器 appName字符串,但这里有... 这个。如果这是OT,请告诉我。 < SCRIPT LANGUAGE =" JavaScript"> 语言属性已折旧,类型是必需的: < script type =" text / javascript"> <! - 开始 隐藏脚本元素内容是不必要的并且可能有害 - 不要这样做。 函数isPPC(){ if(navigator.appVersion.indexOf(" PPC")!= -1)return true; 依靠浏览器告诉你 老实说这是什么平台是非常不可靠的。接受一个好的 的时间百分比是错误的(但这可能不是这个 案例的真正问题)。 检测''PPC''有什么意义? 否则返回false; } 更简单(尽管没有)更准确)功能是: 函数isPPC(){ 返回/PPC/.test(navigator.appVersion); } if(isPPC()){ document.write(''< b> Send< A CLASS =" contact" HREF = \" mailto:\\ \\?subject \ =看看我找到的网站。人们可以看到这个网站 http://www.BrokerAgentTraining.com \" onMouseOver =" window。 status = \''发送给朋友的电子邮件关于这个网站\'';返回trueTITLE =发送你的朋友关于这个网站的电子邮件">这个网站< \ / A>给朋友< / b>''); } 尝试设置我们的代码,清楚''阻止''使错误更容易 来检测。 document.write( ''< b>发送< ;一个CLASS =联系人 HREF =" mailto:?subject =拿一个'', ''查看我找到的网站.?body=你可以看到这个网站'', ''http://www.BrokerAgentTraining.com\" '', ''onMouseOver =" window.status = \''发送给朋友的电子邮件'', ''关于这个网站'\\'' ;返回true;"'', ''TITLE ="发送给你的朋友一封关于这个网站的电子邮件">'', ''这个网站< ; \ / A>给朋友< \ / b>'' ); else {document.write(''< b> Send< A CLASS =" contact" ; HREF = \" mailto:\?body \ =看看我找到的这个网站。你可以看到这个网站 http://www.BrokerAgentTraining.com \ " onMouseOver =" window.status = \''发送给您的好友发送电子邮件关于这个网站\'';返回trueTITLE ="发送您的朋友发送电子邮件至本网站>此网站< \ / A>给朋友< / b>''); document.write( ''< b> Send< A CLASS =" contact" HREF = \" mailto:\ ?body\ =在我找到的这个网站上看一下'', ''你可以看到这个网站'', ''http:// www.BrokerAgentTraining.com \"'', ''onMouseOver =" window.status = \''发送你的朋友的电子邮件'', ''关于这个网站\'';返回true''', ''TITLE ="发送你的朋友关于这个网站的电子邮件">'', ''这个网站< \ / A>给朋友< \ / b>'' ); } //结束 - > < / script> 这是一种不同的方法:将两个选项放在页面中,以便 他们都显示。将每个包裹在div中并为其提供ID。现在通过将其封闭的div'的'b $ b显示设置为''none'来消失(比如说PPC为真的那个)。 在链接之后或作为正文$ / b $ b onload事件的脚本元素中运行测试。如果PPC为真,则将隐藏的div'的显示更改为'''' ,将另一个显示更改为''none'',例如(请原谅长属性 值的包装,它应该仍然可以作为源代码剪切' < div id =" forPPC" style =" display:none;">< b> Send< A CLASS =" contact" HREF =" mailto:?subject =看看我发现的网站。& body =你可以 看到这个网站http://www.BrokerAgentTraining.com" onMouseOver =" window .status =''发送你的朋友发送关于这个网站的电子邮件''; 返回true;" TITLE ="发送给你的朋友一封电子邮件这个网站这个网站< / A>给朋友(PPC)< / b>< / div> < div id =" forOther">< b> Send< A CLASS =" contact" HREF =" mailto :?subject =看看我找到的网站。& body =你可以 在http://www.BrokerAgentTraining.com上查看这个网站。 onMouseOver = window.status =''发送你的朋友发送关于这个网站的电子邮件''; 返回true;" TITLE =向您的朋友发送有关此网站的电子邮件这个网站< / A>给朋友(非PPC)< / b>< / div> < script type =" text / javascript"> if(/PPC/.test(navigator.appVersion) && document.getElementById && document.body.style) { document.getElementById(''forPPC'')。style.display =''''; document.getElementById(''forOther'')。style。 display =''none''; } < / script> 如果一切按计划进行,''PPC''用户启用JavaScript并且诚实 浏览器将看到第一个A,也许当他们点击它们时,他们的 电子邮件客户端将从您的参数开始。在任何其他情况下, 提供了样式对象&支持显示属性,只显示 秒A.. - Rob I can''t figure out why this script won''t insert the subject in the email andwhy can''t I control the font and size being used? I''m not sure where to postthis. Let me know where if this is OT.<SCRIPT LANGUAGE="JavaScript"><!-- Beginfunction isPPC() {if (navigator.appVersion.indexOf("PPC") != -1) return true;else return false;}if(isPPC()) {document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take alook at website I found.?body=You can see this website athttp://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send yourfriends e-mail about this website\''; return true" TITLE="Send your friendse-mail about this website">this website<\/A> to a friend</b>'');}else { document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Takea look at this website I found. You can see this website athttp://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send yourfriends e-mail about this website\''; return true" TITLE="Send your friendse-mail about this website">this website<\/A> to a friend</b>'');}// End --></script>--Warmest regards,Steve Horrillo, Realtor / CEO / C.Ht. http://brokeragenttraining.com (Advanced training for real estateprofessionals) http://over100percent.com (Realtors earn over 100 percenthttp::/hipfsbo.com (a helpful place for the serious home seller or buyer whois open to new ideas) 解决方案 1. "<!----- Begin" is an invalid javascript function. It should havethe slashes in front of it (like the end).2.The slashes in the mailto addy are not supposed to be there.3.Towards the end you put "<\/a>" instead of </a>4.You should probably check out http://msdn.microsoft.com/library/de...ned/mailto.aspas I found it very helpful.l8r Steve Horrillo wrote: I can''t figure out why this script won''t insert the subject in the email and why can''t I control the font and size being used? I''m not sure where to post this. Let me know where if this is OT. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false; } if(isPPC()) { document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at website I found.?body=You can see this website at http://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send your friends e-mail about this website\''; return true" TITLE="Send your friends e-mail about this website">this website<\/A> to a friend</b>''); } else { document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a look at this website I found. You can see this website at http://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send your friends e-mail about this website\''; return true" TITLE="Send your friends e-mail about this website">this website<\/A> to a friend</b>''); } // End --> </script>Your JavaScript has a problem with quotes my friend. My advice whenwriting complicated strings with quotes is to build up the string inbits in a buffer variable. Much much easier to debug.var buf=''<b>Send <A CLASS="contact" HREF="mailto:?subject=Take a'';buf+=''look at website I found.&body=You can see this website at'';buf+='' http://www.BrokerAgentTraining.com" onMouseOver="window.status='';buf+="''Send your friends e-mail about this website''; return true";buf+=''" TITLE="Send your friends e-mail about this website">thiswebsite</a> to a friend</b>'';document.write(buf);Also, mailto link are not reliable, and not all clients will fill in thebody...And the separator from the subject should be a ''&'' not ''?''"mailto:em***@bogus.com?subject=Some subject&body=Your body text"Lastly this is a JavaScript, not Java problem.--Take care,Jonathan-------------------LITTLE WORKS STUDIO http://www.LittleWorksStudio.comSteve Horrillo wrote: I can''t figure out why this script won''t insert the subject in the email and why can''t I control the font and size being used? I''m not sure where to postWhich font and size? In the e-mail or on the page? One ''mailto'' isusing body, the other subject. Was that intended? Otherwise, theyseem to do exactly the same thing.If you mean in the e-mail, you only have whatever is supported by thee-mail client, and you have no idea what that is, what is supports oreven if there is one configured. So you are taking pot luck that thiswill work at all.I have no idea why you are even testing for ''PPC'' in the navigatorappName string, but here goes... this. Let me know where if this is OT. <SCRIPT LANGUAGE="JavaScript">The language attribute is depreciated, type is required:<script type="text/javascript"> <!-- BeginHiding script element content is unnecessary and potentially harmful -don''t do it. function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true;It is very unreliable to depending on the browser to telling youhonestly what the platform is. Accept that it will be wrong a goodpercentage of the time (but that is likely not really an issue in thiscase).What is the point of detecting ''PPC''? else return false; }A simpler (though no more accurate) function is:function isPPC() {return /PPC/.test(navigator.appVersion);} if(isPPC()) { document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at website I found.?body=You can see this website at http://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send your friends e-mail about this website\''; return true" TITLE="Send your friends e-mail about this website">this website<\/A> to a friend</b>''); }Try setting our your code with clear ''blocking'' to make errors easierto detect.document.write(''<b>Send <A CLASS="contact" HREF="mailto:?subject=Take a'','' look at website I found.?body=You can see this website at'','' http://www.BrokerAgentTraining.com\" '','' onMouseOver="window.status=\''Send your friends e-mail'','' about this website\''; return true;"'','' TITLE="Send your friends an e-mail about this website">'','' this website<\/A> to a friend<\/b>''); else { document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a look at this website I found. You can see this website at http://www.BrokerAgentTraining.com\" onMouseOver="window.status=\''Send your friends e-mail about this website\''; return true" TITLE="Send your friends e-mail about this website">this website<\/A> to a friend</b>'');document.write(''<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a'','' look at this website I found. You can see this website at'','' http://www.BrokerAgentTraining.com\" '','' onMouseOver="window.status=\''Send your friends e-mail'','' about this website\''; return true"'','' TITLE="Send your friends e-mail about this website">'','' this website<\/A> to a friend<\/b>''); } // End --> </script>Here''s a different approach: put the two options in your page so thatthey both display. Wrap each in a div and give them an ID. Now makeone disappear (say the one for PPC true) by setting its enclosing div''sdisplay to ''none''.Run your test in a script element just after the links or as a bodyonload event. If PPC is true, change the hidden div''s display to ''''and the other to ''none'', e.g. (please excuse wrapping of long attributevalues, it should still cut ''n paste as source code just fine)<div id="forPPC" style="display: none;"><b>Send <A CLASS="contact"HREF="mailto:?subject=Take a look at website I found.&body=You cansee this website at http://www.BrokerAgentTraining.com"onMouseOver="window.status=''Send your friends e-mail about this website'';return true;"TITLE="Send your friends an e-mail about this website" this website</A> to a friend (PPC)</b></div><div id="forOther"><b>Send <A CLASS="contact"HREF="mailto:?subject=Take a look at website I found.&body=You cansee this website at http://www.BrokerAgentTraining.com"onMouseOver="window.status=''Send your friends e-mail about this website'';return true;"TITLE="Send your friends an e-mail about this website" this website</A> to a friend (non-PPC)</b></div><script type="text/javascript">if ( /PPC/.test(navigator.appVersion)&& document.getElementById&& document.body.style ) {document.getElementById(''forPPC'').style.display = '''';document.getElementById(''forOther'').style.display = ''none'';}</script>If all goes to plan, ''PPC'' users with JavaScript enabled and honestbrowsers will see the first A and maybe when they click on it theire-mail client will start with your parameters. In any other case,provided the style object & display property are supported, only thesecond A will be shown.--Rob 这篇关于发送给朋友和Java问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-18 08:30
查看更多