Forum Moderators: open

Message Too Old, No Replies

Using JS to write in html content

Browser Support

         

molecularr

7:18 pm on Sep 1, 2004 (gmt 0)

10+ Year Member



Hello.

I'm working a with a Javascript file that writes in content (document.write) from an external source and plops it into a web page. Think of it like harder way to do the same thing as SSI (obviously, I'm not on an Apache server).

The problem is that it doesn't seem to work on NS 4.7 (Sun/Linux) though it works fine on everything else I've tested (i.e. modern browsers on Macs + PCs). My question is this: is this a specific browser incompatibility (in which case I may not even worry about it if it's just this browser), or is there something generally improper about my technique?

In other words, should I worry about it at all?

StupidScript

11:03 pm on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What method are you using to pull the data from the external source?

document.write is fully supported by all Netscape browsers back to 2.0, so I'm guessing it's how you include the data that is the problem.

Lord Majestic

11:08 pm on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could (but should not) be some buffering issues?

Try adding document.writeln(""); it might just be it. Otherwise I can't see what you doing wrong apart from (in principle) generating HTML using JavaScript which would preclude robots from seeing it (so no place in search engines).

molecularr

8:24 pm on Sep 2, 2004 (gmt 0)

10+ Year Member



Oddly enough it seems to be working now. (?) Oh well.
Thanks for the input anyway.

Incidentally, Lord Majestic, part of my reason for doing it this way is in fact to hide the content from search engines.

The html at issue is image code, and the images in question are in some cases protected by copyright. Our use is "fair" since we're an academic journal and access is (sort of) monitored. One of the stipulations of our lawyer people was that we have to make it as hard as possible to prevent average users from saving the images to their machine.

So part of my solution is to use javascript to write in the "secret" code that prints the image source. I realize that prevents users with javascript disabled from seeing images at all, but I'm working on that. I at least wanted to get the primary technique in place that will work for most of my average users.

Thanks all.

M

Bernard Marx

8:37 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



to make it as hard as possible to prevent average users from saving the images to their machine

This won't make the slightest iota of difference wrt that. It's not worth the bother, since the effect is nil (not including those who won't get any content at all).

StupidScript

9:45 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But at least Google won't make the images available via its Image Search, which will keep many people from becoming aware of the images.

Bernard Marx

8:53 am on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In guess that's true. They can only catalogue images that are explicitly linked from web pages (?).

I still reckon it's a load of fuss though. There might be a better load of fuss to apply instead. Couldn't the server be configured only to serve the images when requested from the correct pages, thus preventing them from appearing in SE image results (visually)?

molecularr

4:26 am on Sep 5, 2004 (gmt 0)

10+ Year Member



Bernard,

It sure would work, but that's not available in my case, unfortunately. I'm not allowed to tinker with this servers config or .htaccess or any of the other avenues by which some claim to "prevent" users from stealing their images.

I'm content that I've (hopefully) kept my images out of search engines and that I've thrown up a few hurdles. At least, that makes me content that I've fulfilled my legal obligation.