Home › Forums › JavaScript › Runnig Javascript from Inside a Frame
- This topic is empty.
-
AuthorPosts
-
February 4, 2015 at 7:18 am #195077Historical Forums UserParticipant
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.February 4, 2015 at 7:32 am #195082SenffParticipantA 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?
February 4, 2015 at 7:47 am #195083Historical Forums UserParticipantI’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?February 4, 2015 at 8:06 am #195084SenffParticipantYea 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.
February 4, 2015 at 8:53 am #195087Historical Forums UserParticipantSomething 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
February 4, 2015 at 10:28 am #195099SenffParticipantDon’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.
February 4, 2015 at 11:02 am #195104Historical Forums UserParticipantFebruary 4, 2015 at 11:23 am #195105SenffParticipantFebruary 4, 2015 at 12:01 pm #195109Historical Forums UserParticipantLooks 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…
February 5, 2015 at 2:39 am #195151Historical Forums UserParticipantAny 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.
February 5, 2015 at 1:13 pm #195184Historical Forums UserParticipantI 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
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.