Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

innerHTML issue

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  namecheap.com domains disappearing from WHOIS?  
Author Message
user273

External


Since: Oct 23, 2003
Posts: 12



(Msg. 1) Posted: Wed Oct 13, 2004 8:15 pm
Post subject: innerHTML issue
Archived from groups: alt>www>webmaster (more info?)

We have a web site where printer-friendly pages are generated on the fly by
using the following JavaScript:

<script language="javascript">
function PrintThisPage()
{
var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
sOption+="scrollbars=yes,width=750,height=600,left=100,top=25";

var sWinHTML1 = document.getElementById('content').innerHTML;

var winprint=window.open("","printer",sOption);
winprint.document.open();
winprint.document.write('<html><body><h1>Our Web Site - Printer
friendly version</h1>');
winprint.document.write(sWinHTML1);
winprint.document.write('</body></html>');
winprint.document.close();
winprint.focus();
}
</script>

This generates a new version of the page using only content defined between
div elements ie <div id=content> and </div>. Everything else is ignored.

The new page is called with <a href="javascript:PrintThisPage();" >Printer
Friendly Version</a>

Everything worked in all browsers tested... until we "encrypted" our e-mail
addresses. Now the Printer Friendly facility only works in IE and Opera, but
not in Netscape and Mozilla.

The "encrypted" e-mail addresses are in the format:

<script language="JavaScript">
<!--
var name = "my.name";
var domain = "mysite.co.uk";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>

It seems there's a clash with the document.write statements in the source
page that IE and Opera can handle, but Netscape and Mozilla cannot.

Can anyone throw any light on this issue?

 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 952



(Msg. 2) Posted: Wed Oct 13, 2004 8:15 pm
Post subject: Re: innerHTML issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 13 Oct 2004 17:15:50 +0100, Carl Tusler <carl.tusler.DeleteThis@REMOVE.co.uk>
wrote:

[snip]

 > Can anyone throw any light on this issue?

The page is already being dynamically created with javascript. Don't
obsfucate your email addresses.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
spam23

External


Since: Sep 24, 2004
Posts: 73



(Msg. 3) Posted: Thu Oct 14, 2004 4:20 am
Post subject: Re: innerHTML issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"GreyWyvern" <spam.RemoveThis@greywyvern.com> wrote in
 > On Wed, 13 Oct 2004 17:15:50 +0100, Carl Tusler <carl.tusler.RemoveThis@REMOVE.co.uk>
 > wrote:
 >
 > [snip]
 >
  > > Can anyone throw any light on this issue?
 >
 > The page is already being dynamically created with javascript. Don't
 > obsfucate your email addresses.
 >

you could use innerhtml instead of write

Herc<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
user273

External


Since: Oct 23, 2003
Posts: 12



(Msg. 4) Posted: Thu Oct 14, 2004 11:20 am
Post subject: Re: innerHTML issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grey, thanks. Yes the printer-friendly page is being created dynamically
from the published source page. We don't want e-mail addresses harvested so
the addresses in the published source page are obsfucated. That's the
problem. Regards, Carl

"GreyWyvern" <spam.RemoveThis@greywyvern.com> wrote in message
news:opsfth7epusl6xfd@news.nas.net...
 > On Wed, 13 Oct 2004 17:15:50 +0100, Carl Tusler <carl.tusler.RemoveThis@REMOVE.co.uk>
 > wrote:
 >
 > [snip]
 >
  > > Can anyone throw any light on this issue?
 >
 > The page is already being dynamically created with javascript. Don't
 > obsfucate your email addresses.
 >
 > Grey
 >
 > --
 > The technical axiom that nothing is impossible sinisterly implies the
 > pitfall corollory that nothing is ridiculous.
 > - <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
 > Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
user273

External


Since: Oct 23, 2003
Posts: 12



(Msg. 5) Posted: Thu Oct 14, 2004 11:21 am
Post subject: Re: innerHTML issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Herc, thanks. I'm not a JavaScript whizz. Give me a clue how this would
be done. Regards, Carl

"|-|erc" <spam DeleteThis @fodder.abc> wrote in message
news:Ovkbd.24799$5O5.13898@news-server.bigpond.net.au...
 > "GreyWyvern" <spam DeleteThis @greywyvern.com> wrote in
  > > On Wed, 13 Oct 2004 17:15:50 +0100, Carl Tusler
<carl.tusler DeleteThis @REMOVE.co.uk>
  > > wrote:
  > >
  > > [snip]
  > >
   > > > Can anyone throw any light on this issue?
  > >
  > > The page is already being dynamically created with javascript. Don't
  > > obsfucate your email addresses.
  > >
 >
 > you could use innerhtml instead of write
 >
 > Herc
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
spam23

External


Since: Sep 24, 2004
Posts: 73



(Msg. 6) Posted: Thu Oct 14, 2004 1:15 pm
Post subject: Re: innerHTML issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Carl Tusler" <carl.tusler.DeleteThis@REMOVE.co.uk> wrote in
 > Hi Herc, thanks. I'm not a JavaScript whizz. Give me a clue how this would
 > be done. Regards, Carl
 >

See where you used innerhtml here to READ between the DIV and /DIV

var sWinHTML1 = document.getElementById('content').innerHTML;


Works the other way aswell. This is how drop down menus dynamically change the screen.
Sounds like you'd have to nest your DIV sections.

function setemails() {
document.getElementById('emails').innerHTML = '<a href=\"mailto:' + name + '@' + domain + '\">'
+ name + '@' + domain + '</a>'
}

<body onload="setemails()">
....
<div id='content'>
....
<div id='emails'></div>
...
</div>


Once its loaded it will insert HTML inside the empty div. I'm not sure how it helps
the bots run write and javascript aswell you know.

Herc


 > "|-|erc" <spam.DeleteThis@fodder.abc> wrote in message
 > news:Ovkbd.24799$5O5.13898@news-server.bigpond.net.au...
  > > "GreyWyvern" <spam.DeleteThis@greywyvern.com> wrote in
   > > > On Wed, 13 Oct 2004 17:15:50 +0100, Carl Tusler
 > <carl.tusler.DeleteThis@REMOVE.co.uk>
   > > > wrote:
   > > >
   > > > [snip]
   > > >
   > > > > Can anyone throw any light on this issue?
   > > >
   > > > The page is already being dynamically created with javascript. Don't
   > > > obsfucate your email addresses.
   > > >
  > >
  > > you could use innerhtml instead of write
  > >
  > > Herc
  > >
  > >
  > >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: innerHTML issue 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Dreamweaver Issue - I made my site based on a dreamweaver template. For some reason when I update the template and save it - the template asks me if I'd like to update the other pages using this template. When I do save it .. whether i use save/save as/save all - The..

URL issue -- Can you advise? - Ok here's the deal. Host A has a web site. It is http://xyz.org Host B has a web site. It is http://abc.org I want Host B to look like http://abc.xyz.org Please keep in mind the sites are on two different web hosts. Now...you can get to the root..

The real issue with Google... - Hello I was reading the thread about Gmail. Surely Google's biggest problem is that thier search results have become less useful over the past 6 months. I don't know what they have done, but I am finding it much harder to find what I want using Google. I...

Mozilla protocol security issue - What Mozilla users should know about the shell: protocol security issue On July 7 (yesterday) a security vulnerability affecting browsers for the Windows operating system was posted to Full Disclosure, a public security mailing list. On the same day, th...

Security issue noticed in Webstat - Hi, I have noticed that in Webstat for my site (which gets about 400-600 visitors a day) that under 'usernames' there are some entries. But this is impossible because I have not created any users in ht.access or Plesk or anywhere else and they do not..
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]