Solved

simple JavaScript webpage doesn't work

Posted on 2015-01-06
9
226 Views
Last Modified: 2015-01-06
Dear Experts,

here is a small page which uses JavaScript (and works fine):
http://tiny.cc/fah1rx

here is downloaded version of this page (and does not work):
http://www39.zippyshare.com/v/70694960/file.html

why the downloaded version doesn't work?
I am quite sure all files are downloaded and links are OK - at least in HTML, I do not know JS.

Could any JavaScript Expert please skim the source and tell me what needs to be modified to make it work?

many thanks for help!
Jarek
0
Comment
Question by:ja-rek
9 Comments
 
LVL 35

Assisted Solution

by:Kimputer
Kimputer earned 25 total points
ID: 40533317
Downloaded zip file, extracted in a folder, ran attack441.htm, saw all the 4 moves (essentially more moves though).
I.e. I don't understand your problem, it works as it should.
0
 
LVL 1

Author Comment

by:ja-rek
ID: 40533342
Hi Kimputer,

first of all thank you for willingness to help me!

on the left side of the window (left frame) there is a board with pieces.
below the board there is a line of six buttons - first one is "Start", last one is "End"
In between there is a ">" button.
When I am pressing the ">" button using online version, pieces move on the board.
Nothing happens after pressing button in offline version.

thanks again!
0
 
LVL 4

Assisted Solution

by:hulsebosch
hulsebosch earned 25 total points
ID: 40533352
The script works just fine.
I think your browser is blocking a script.
What browser are you using?
0
 
LVL 38

Assisted Solution

by:Tom Beck
Tom Beck earned 50 total points
ID: 40533353
It fails in Chrome. You are up against the "Same origin policy" with regard to the use of frames and local files. It's a security feature. There's no easy fix. This should really be done with one html page divided into left and right containers.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 22

Assisted Solution

by:Snarf0001
Snarf0001 earned 400 total points
ID: 40533354
Are you running this through Chrome?
If so, you're most likely having cross domain issues.  If you're running this right from a file system (ie not through a web server, even a local one), Chrome will block cross-frame javascript access to null domains.

IE / Firefox will allow the access, Chrome doesn't
0
 
LVL 1

Author Comment

by:ja-rek
ID: 40533358
I am using Chrome - both for the online and offline version.
I have now opened it in Firefox and works fine.
Is there a way to view it in Chrome e.g. by changing some security setting?
0
 
LVL 22

Accepted Solution

by:
Snarf0001 earned 400 total points
ID: 40533388
Security setting no, but you can temporarily disable it with command line arguments.
Find where Chrome is on your system, most likely Program Files (x86)\Google\Chrome\Application

Open a command prompt and go to that directory, and start chrome from the command line like this:

chrome.exe --allow-file-access-from-files --disable-web-security

You HAVE to have all chrome windows closed before running this.
That should give you a warning about reduced security, but let you run the script.
0
 
LVL 1

Author Comment

by:ja-rek
ID: 40533416
thanks Snarf0001, it works!

Just one clarification:
it seems --disable-web-security no longer works (Chrome displayed a message)
but  --allow-file-access-from-files is enough to make it work.
0
 
LVL 1

Author Closing Comment

by:ja-rek
ID: 40533672
thanks again for help!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now