Solved

How-To Lockdown .js Files

Posted on 2009-07-13
3
451 Views
Last Modified: 2012-05-07
I have a page that displays an adobe flash file on load of the page via an html document.  Inside the html document I am loading the flash file via javascript.

I would like to:
1 - Lock down the HTML so the user can not see the references to the javascript information
2 - Lock down the .js file so the user can now access it directly via a URL/Command (i.e. hxxp://webpage.com/script.js)

I have full access to my webhost via cpanel.  Any ideas would be greatly appreciated.
-------------
index.html
-------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="Landscape design" />
<title>webpage</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="flash.js" language="JavaScript" type="text/javascript"></script>
</head>
<body>
<div><script language="JavaScript" type="text/javascript">RunFlash();</script></div>
</body>
</html>
 
---------
flash.js
---------
function RunFlash()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%" height="800">');
document.write('<param name="movie" value="flash.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<embed src="flash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="800" />');
document.write('</object>');
}

Open in new window

0
Comment
Question by:aehare70
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 24845122
This is not possible. You can scramble your code, but this will just trigger the curiosity of anyone looking at your source, you can not prevent anyone from accessing your .js file.

There might be other options. If you explain what problem you are trying to solve, we might be able to provide you with a usefull advice.
0
 
LVL 7

Expert Comment

by:Jonah11
ID: 24845935
If you want to prevent direct access to the files, you could do something like creating a new special token   on each page load that only works one time.  But as cxr said, you cannot "lockdown" html or js.
0
 
LVL 1

Author Comment

by:aehare70
ID: 24850274
Well that sucks.  Thank you.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Obsolete font tag need to convert to CSS 3 36
Drop Down not working in mobile- Bootstrap 14 33
Political Map of Europe - Wikipedia? 4 26
BatchFile-Disk Detection 23 30
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question