CodeIgniter Forums
safe_mailto question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: safe_mailto question (/showthread.php?tid=16911)



safe_mailto question - El Forum - 03-20-2009

[eluser]Atasa[/eluser]
when i say to my page safe_mailto it produces 2 things.
One javascript version, and the html a tag itself.
EXAMPLE
Code:
<javascript version with all the numbers>
     ....All the numers Array...
     for (var i = l.length-1; i >= 0; i=i-1){
    if (l[i].substring(0, 1) == '|') [removed]("&#"+unescape(l[i].substring(1))+";");
     else [removed](unescape(l[i]));}
     //]]>
    </javascript><a href="mailto:[email protected]" title="Contact us!">[email protected]</a>

Is that what safe_mailto suppose to do, because the mail address is there to.


safe_mailto question - El Forum - 03-20-2009

[eluser]Référencement Google[/eluser]
If you check the code with Firebug or some JS debugger you will see the result of the script too, so in your case you will see the <a> link, but check the source code instead to see that the email doesn't appear in clear for the bots.


safe_mailto question - El Forum - 03-20-2009

[eluser]Atasa[/eluser]
thanx for the reply,
What i mean is that in the source code i see both versions the javascript one and the html one,
but in page is displayed just once.


safe_mailto question - El Forum - 03-20-2009

[eluser]Référencement Google[/eluser]
Then you should have a kind of JS script renderer or something like that, you shouldn't see the <a> link until you made mistake in your programming.

If you want us to help, please provide the source code you use, and also what system you use (firefox, with firebug, with what are you looking at the source code?)


safe_mailto question - El Forum - 03-20-2009

[eluser]Atasa[/eluser]
You want believe this....
If right click on firefox and select View Page Source I see only the JavaScript Version.
But if just select the area around the link and then right click and select View Selection Source, then I see both versions.
Very Strange, and wich one is the correct?

In Firebug when I inspect the element I only see the html version.

My code is:
Code:
echo safe_mailto('[email protected]', '[email protected]',  array('title' => 'Contact Us!'));



safe_mailto question - El Forum - 03-20-2009

[eluser]Référencement Google[/eluser]
Firefox renders the JS when selecting it, using the way you was doing. That explains why you was seeing the rendered code.


safe_mailto question - El Forum - 03-20-2009

[eluser]Atasa[/eluser]
Thank you Too Pixel....