Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

simple JavaScript webpage doesn't work

Posted on 2015-01-06
9
Medium Priority
?
253 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
[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
9 Comments
 
LVL 36

Assisted Solution

by:Kimputer
Kimputer earned 100 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 100 total points
ID: 40533352
The script works just fine.
I think your browser is blocking a script.
What browser are you using?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 38

Assisted Solution

by:Tom Beck
Tom Beck earned 200 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
 
LVL 23

Assisted Solution

by:Snarf0001
Snarf0001 earned 1600 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 23

Accepted Solution

by:
Snarf0001 earned 1600 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to count occurrences of each item in an array.

609 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