473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Prevent Javascript from being downloaded

Ryu
Hi,

May I know how to prevent Javascript from being dlownloaded when the user
saves at "View Source"? I have added "js" at IIS's application
configuration's mapping and i have added the following at web.config:
But the javascript is still being downloaded. Please help

<httpHandlers>
<add verb="*" path="../ig_common.js"
type="System.Web.HttpForbiddenHandler"/>

</httpHandlers>


Nov 18 '05 #1
3 3205
WL
Well,

Javascript that has to be executed at the client side must be sent to the
client, and since Javascript is an interpreted language there is *NO* way of
preventing the user to download and see the Javascript code.

You could try to make it as difficult as possible, but there will be always
a way to see the code: the borwser should see it as well, no ?

The best option, in my opinion, is to obfuscate the Javascript code: see
http://www.syntropy.se for example.

Wim

"Ryu" <bl***************@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Hi,

May I know how to prevent Javascript from being dlownloaded when the user
saves at "View Source"? I have added "js" at IIS's application
configuration's mapping and i have added the following at web.config:
But the javascript is still being downloaded. Please help

<httpHandlers>
<add verb="*" path="../ig_common.js"
type="System.Web.HttpForbiddenHandler"/>

</httpHandlers>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.747 / Virus Database: 499 - Release Date: 01/09/04
Nov 18 '05 #2
Hi Ryu,

You can also copy the code in .js file to the ASPX file within the <script>
</script> tag.
and you can prevent the user from doing the View Source in the browser (of
course you need to write code for this ).

Check this thread which will help you achive disabling the view -> source
option.
http://www.experts-exchange.com/Web/..._20661699.html

This way you will be able to giveout the .js file to the user.

Hope this helps you.

Thanks
Raghavendra

"Ryu" <bl***************@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Hi,

May I know how to prevent Javascript from being dlownloaded when the user
saves at "View Source"? I have added "js" at IIS's application
configuration's mapping and i have added the following at web.config:
But the javascript is still being downloaded. Please help

<httpHandlers>
<add verb="*" path="../ig_common.js"
type="System.Web.HttpForbiddenHandler"/>

</httpHandlers>

Nov 18 '05 #3
> Javascript that has to be executed at the client side must be sent to the
client, and since Javascript is an interpreted language there is *NO* way of preventing the user to download and see the Javascript code.
I thought so too, until last week. A colleague developed a test page that
uses an ASP page for the (external) javascript source. I'm not sure how he
kept it out of the browser cache, but it certainly wasn't in there. I would
suspect it had something to do with the headers it sent with the script
document.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"WL" <no****@nospam.nospam> wrote in message
news:#o**************@tk2msftngp13.phx.gbl... Well,

Javascript that has to be executed at the client side must be sent to the
client, and since Javascript is an interpreted language there is *NO* way of preventing the user to download and see the Javascript code.

You could try to make it as difficult as possible, but there will be always a way to see the code: the borwser should see it as well, no ?

The best option, in my opinion, is to obfuscate the Javascript code: see
http://www.syntropy.se for example.

Wim

"Ryu" <bl***************@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Hi,

May I know how to prevent Javascript from being dlownloaded when the user saves at "View Source"? I have added "js" at IIS's application
configuration's mapping and i have added the following at web.config:
But the javascript is still being downloaded. Please help

<httpHandlers>
<add verb="*" path="../ig_common.js"
type="System.Web.HttpForbiddenHandler"/>

</httpHandlers>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.747 / Virus Database: 499 - Release Date: 01/09/04

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel | last post by:
Does anyone know how this can be done? Thanks
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
2
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
9
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx)...
11
by: moondaddy | last post by:
I have images that I need to prevent the user from doing a right click and selecting "Save Picture As"? How can I do this? -- moondaddy@nospam.com
3
by: Angus | last post by:
I have a program which when downloaded from a server downloads another program from the same web server and then configures the downloaded program. The trouble is I have to hard code in the...
1
by: Rocker1 | last post by:
Hello guys, I am reading a downloaded textfile which has a fields like date,NAV and Name using VB.NET. The date on which the textfile is downloaded remains the same.After each readline operation...
12
by: Queez | last post by:
I have a .NET assembly (ScanControl.dll), which accesses a scanner on my client's local machine and allows them to scan a page (Scan()). I have an ASP.NET web application with a page which will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.