?
Solved

simple JavaScript webpage doesn't work

Posted on 2015-01-06
9
Medium Priority
?
245 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
Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

 
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

Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

765 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