Solved

simple JavaScript webpage doesn't work

Posted on 2015-01-06
9
239 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 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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
 
LVL 23

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 23

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

696 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