473,671 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.We b.HttpForbidden Handler"/>

</httpHandlers>


Nov 18 '05 #1
3 3227
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******** ******@TK2MSFTN GP11.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.We b.HttpForbidden Handler"/>

</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******** ******@TK2MSFTN GP11.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.We b.HttpForbidden Handler"/>

</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******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP11.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.We b.HttpForbidden Handler"/>

</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
2316
by: Daniel | last post by:
Does anyone know how this can be done? Thanks
53
5694
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 difficult to know what is going on. One of these Order Forms you can see here... http://www.cardman.co.uk/orderform.php3
2
3811
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 because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load fully.
136
9315
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
9
2277
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) as a popup using either window.open or window.showModalDialog. Since I want to warn the users of my application when they try to close page1.aspx and have changed the values in the meantime I thought about using the “onbeforeunload” event of the...
11
3049
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
2411
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 program the URL to download the other program from. So I need to work out how I can do the same thing without having a hard coded URL in the file. It is an executable generated from a C compiler so I don't want customers to have to edit a C source...
1
5014
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 it looks into the Access DB (tablename:Details) and updates the 3 columns(Date,NAV,Name).My question is how do i prevent the user accesing the already downloaded file or in other words how do i prevent my DB being loaded with duplicate values in...
12
2576
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 (theoretically) use this control to allow a user to scan a page into my database (Scan.aspx). I serve the control as an object on the page, like so: <object id="scanningObj" height="300px" width="500px"...
0
8481
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8400
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8672
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7441
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4412
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.