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


Groups > comp.lang.javascript > #37684 > unrolled thread

iframe path to file incorrect

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2019-11-04 16:28 +1100
Last post2019-11-04 16:28 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript


Contents

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

#37684 — iframe path to file incorrect

FromAndrew Poulos <ap_prog@hotmail.com>
Date2019-11-04 16:28 +1100
Subjectiframe path to file incorrect
Message-ID<5eKdnWSZpp1qKyLAnZ2dnUU7-afNnZ2d@westnet.com.au>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web