Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37684

iframe path to file incorrect

Newsgroups comp.lang.javascript
From Andrew Poulos <ap_prog@hotmail.com>
Subject iframe path to file incorrect
Date 2019-11-04 16:28 +1100
Message-ID <5eKdnWSZpp1qKyLAnZ2dnUU7-afNnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


I have a parent page with an iframe. The parent sits in one folder 
called '... project/exercises' and the iframe HTML is in a sub folder 
called '... project/exercises/preview'

The iframe has a script element
   <script src='../scripts/chart.min.js'></script>

as well as its own functions eg.

<script>
function test() {
   ...
}


If I call test() from the parent with

window.frames[0].contentWindow.test();

I get a 404 error with
   ... project/scripts/chart.min.js

How can I get it to look for
   ... project/exercises/scripts/chart.min.js
instead?

Andrew Poulos

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

iframe path to file incorrect Andrew Poulos <ap_prog@hotmail.com> - 2019-11-04 16:28 +1100

csiph-web