Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Runnig Javascript from Inside a Frame

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #195077

    I have an index file with a frameset of two rows, one of which is linked to a file (frame1.html) that contains a javascript that’s creating a sort of animation.

    For some reason the animation is not playing inside the index file.

    Note that if I open directly frame1.html it plays just fine, meaning that the javascript is working well on its own.

    The files are also properly linked because the CSS properties from frame1.html are being correctly applied to frame1 inside the index file. It’s simply the javascript animation that isn’t running.

    I’ve never worked with frames befores so am not sure what I could be missing…

    I’m not sure if I should (or how I could) use CodePen for a case like this.

    Any help will be highly appreciated.
    Thanks.

    #195082
    Senff
    Participant

    A frame never interacts with the page it’s embedded on — it’s always its own entity — so it’s possible that the Javascript actually checks if it’s in a frame or not.

    It’s hard to guess what could be wrong if we don’t see it, but on Codepen you can use frames too, but I guess the page that’s in the frame should be an external page. Not a chance we can see the actual page in action?

    #195083

    I’m not sure I understand you first paragraph.
    It’s not meant to interact with anything. It’s supposed to be like a window (literally!) to a different page. The problem is that the “window” (frame) is not showing the full picture. CSS properties, like background color, are being applied but the anymation isn’t running.

    I guess I could upload the whole thing to dropbox.
    Would that be okay?

    #195084
    Senff
    Participant

    Yea it’s kinda hard to explain what I mean…I’m trying to say that code on a page doesn’t care if it’s run independently or within an iframe, it should always work the same.

    EXCEPT when that code actually checks if it’s being run in an iframe and makes decisions based on that.

    Sure a Dropbox link could work as long as it’s functional for “outside” people who view the page.

    #195087

    Something really weird is going on.

    I just noticed that in Firefox and Chrome it actually appears to work fine.

    In Safari, however sometimes it plays, and some… well, most of the times it doesn’t. In IE doesn’t work as well. Don’t know why.

    Here it is: https://www.dropbox.com/s/8j2pi5szdjn7c0f/untitled.rar

    #195099
    Senff
    Participant

    Don’t use a compressed file for us to download, install, etc.

    Better put all your files in a subfolder in your Dropbox, make it work and then share it so that we can access it directly by going to a URL.

    #195104
    #195105
    Senff
    Participant
    #195109

    Looks like I can’t do that.

    “If you would still like to enable your Public folder, you must be a Dropbox Pro or Dropbox for Business user. Currently only Pro and Business users may enable Public folders from this page.”

    I understand not wanting to unzip an unknown folder, but this last link I posted is for the individual files, all uncompressed. It’s only a few…

    #195151

    Any ideas?

    Safari’s error console shows me an issue with the three.js file, but I don’t know how to debug it. Not even if that’s what’s causing these issues.

    #195184

    I don’t wanna come across as an ungrateful bastard, but downloading a 500Kb folder (uncompressed!) with a couple of files to simply open the index.html (like if it were online) isn’t really “building the whole thing from scratch”.

    Of course the site isn’t online, otherwise…

    The error says

    THREE.WebGLRenderer 59
    
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.