The Original Gay Porn Community - Free Gay Movies and Photos, Gay Porn Site Reviews and Adult Gay Forums

  • Welcome To Just Us Boys - The World's Largest Gay Message Board Community

    In order to comply with recent US Supreme Court rulings regarding adult content, we will be making changes in the future to require that you log into your account to view adult content on the site.
    If you do not have an account, please register.
    REGISTER HERE - 100% FREE / We Will Never Sell Your Info

    PLEASE READ: To register, turn off your VPN (iPhone users- disable iCloud); you can re-enable the VPN after registration. You must maintain an active email address on your account: disposable email addresses cannot be used to register.

Javascript use query

star-warrior

JUB 10k Club
JUB Supporter
Joined
Jul 6, 2005
Posts
41,663
Reaction score
14
Points
0
Location
Home is where the heart is
Website
www.myspace.com
I am writing a website that may require the addition of a piece of javascript to stop right-clicking (I know, it doesn't deter the determined). Since there may potentially be several tens of pages, can I just keep the javascript in one file and have each webpage link to it, (rather like the way stylesheets work) than having to copy and paste it each time and then having to scroll past it every time I edit the webpage?

Thanks in advance.
 
yes, you can do that with an external JS file. (file_name.js) I put an example below for you. :)

Code:
<script type="text/javascript" src="/file/path/to/file.js"></script>
 
Don't do it.
It's bad practice, fucking annoying and does block other useful functions.
 
<script type="text/javascript" src="/file/path/to/file.js"></script>

Thanks guys for the prompt reply, and Corny, I had a look at w3schools.com for the <script> tag and there was a link to the IANA mime types that then linked to

http://www.rfc-editor.org/rfc/rfc4329.txt says

Use of the "text" top-level type for this kind of content is known to be problematic. This document thus defines text/javascript and text/ ecmascript but marks them as "obsolete".

But, w3schools says

According to IANA, the "text/javascript" MIME type is obsolete. The new standard is "application/javascript". However, "application/javascript" is not supported by Internet Explorer.

So, it seems that copy and paste is gonna be the order of the day, sadly.
 
OK, I tried using the script tag, but it didn't work as a seperate file.

I'm using the rather famous/infamous barts1000 right click disabling script in combination with

<BODY ondragstart="return false" onselectstart="return false">

to prevent copy and paste. Is the body tag considered bad practice? And is there an alternative?
 
Let me get this straight: ANY kind of JS that is preventing a user from rightclicking is bad practice. No matter how you implement it. There are many many reasons to use a rightclick besides copy and paste.

I for one use a lot the "open in new tab" feature by middle clicking a link - some anti-right-click scripts already prevent this, but some mice don't have a middle click or using the middle click for something else, thus have to use the right click. You would be limiting their browsing experience.
Many browser also offer dictionary/search functions that either need you to mark or mark and drag or rightclick a word. You would disable those, too.
It is reason enough for me (and many other users) not to use a website. Other users just have javascript disabled (some browsers or browser plugin already offer to block those scripts), so your win is marginal.
 
I've had web content stolen and disseminated without permission before, despite the copyright statement. Its really put a downer on my writing web content for online publication, and this project which I'm doing is text based.

It's going to be a grammar and lessons site for a minority language. I've already created a dictionary and written two thirds of the grammar, I've yet to do the syntax stuff and write the lessons. Now that I'm this far in, I want to publish, but not be damned.

The minority language for English learners is a niche subject, and the published works for learning in English on the language are now out of print, and virtually impossible to find lessons for on the internet, I'm plugging the gap.

But it would be soul crushing for it just to be stolen and attributed to someone else.

I don't have the resources to fight copyright infringement, so this was the route I was thinking of taking. Is it really that bad?
 
I understand all the reasons why you would do that. I am just saying that it probably will scare off more users than prevent any stealing.
Javascript is NO obstacle for anyone who wants to copy something off a website.

You could make this complicated and embedd the text in some flash movies, that would make it at least harder - but still not impossible.
 
You do understand that if you stop the JS support in the browser you have 0 protection?
Even though... there are THOUSANDS of ways to copy text of your page even if JS is turned on.

Btw, go unobtrusive!
 
I'm with Corny here. It's more of an annoyance than a way to stop someone stealing your work. If a client asked me to do that I would strongly advise them that it was a bad idea.

Have you heard of http://www.copyscape.com ? With that you can see if anyone is copying your work. Usually a polite email will do the trick. Or in the web geek world a simple tweet on Twitter or blog post usually does the trick!
 
Back
Top